git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv1 1/1] git-p4: avoid leak of file handle when cloning

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 30, 2020, 20:22 UTC
Message-ID
<xmqqv9osbsov.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20200130115034.6191-2-luke@diamand.org>
Luke Diamand <luke@diamand.org> writes:
Show 23 quoted lines
> Spotted by Eric Sunshine:
>
>     https://public-inbox.org/git/CAPig+cRx3hG64nuDie69o_gdX39F=sR6D8LyA7J1rCErgu0aMA@mail.gmail.com/
>
> Signed-off-by: Luke Diamand <luke@diamand.org>
> ---
>  git-p4.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/git-p4.py b/git-p4.py
> index eb5bc28cf9..9a71a6690d 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -3563,7 +3563,8 @@ def importRevisions(self, args, branch_arg_given):
>          changes = []
>  
>          if len(self.changesFile) > 0:
> -            output = open(self.changesFile).readlines()
> +            with open(self.changesFile) as f:
> +                output = f.readlines()
>              changeSet = set()
>              for line in output:
>                  changeSet.add(int(line))

I was scratching my head until I realized that this is PATCH 7/6 of the other 6-patch series.

Will queue together with the other ones.  Thanks.
Previous: Luke Diamand
Message 3 of 3 in “[PATCHv1 0/1] git-p4: fix file descriptor leak”
  1. Luke DiamandJan 30, 2020
  2. 1/1 git-p4: avoid leak of file handle when cloningLuke Diamand, Jan 30, 2020
  3. Junio C HamanoJan 30, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.