{"thread":{"id":"52717","subject":"[PATCHv1 0/1] git-p4: fix file descriptor leak","startedAt":"2020-01-30T11:50:54Z","lastAt":"2020-01-30T20:22:32Z","messageCount":3,"participants":["Luke Diamand","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"390786","messageId":"20200130115034.6191-1-luke@diamand.org","threadId":"52717","inReplyTo":null,"subject":"[PATCHv1 0/1] git-p4: fix file descriptor leak","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2020-01-30T11:50:33Z","receivedAt":"2020-01-30T11:50:54Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"Spotted by Eric Sunshine here:\n\n    https://public-inbox.org/git/CAPig+cRx3hG64nuDie69o_gdX39F=sR6D8LyA7J1rCErgu0aMA@mail.gmail.com/\n\nThere are at least two more of these, but I would prefer to leave them\nalone until the python3 changes have been merged.\n\nLuke Diamand (1):\n  git-p4: avoid leak of file handle when cloning\n\n git-p4.py | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\n-- \n2.20.1.390.gb5101f9297\n\n"},{"id":"390787","messageId":"20200130115034.6191-2-luke@diamand.org","threadId":"52717","inReplyTo":"20200130115034.6191-1-luke@diamand.org","subject":"[PATCHv1 1/1] git-p4: avoid leak of file handle when cloning","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2020-01-30T11:50:34Z","receivedAt":"2020-01-30T11:50:55Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"Spotted by Eric Sunshine:\n\n    https://public-inbox.org/git/CAPig+cRx3hG64nuDie69o_gdX39F=sR6D8LyA7J1rCErgu0aMA@mail.gmail.com/\n\nSigned-off-by: Luke Diamand <luke@diamand.org>\n---\n git-p4.py | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/git-p4.py b/git-p4.py\nindex eb5bc28cf9..9a71a6690d 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -3563,7 +3563,8 @@ def importRevisions(self, args, branch_arg_given):\n         changes = []\n \n         if len(self.changesFile) > 0:\n-            output = open(self.changesFile).readlines()\n+            with open(self.changesFile) as f:\n+                output = f.readlines()\n             changeSet = set()\n             for line in output:\n                 changeSet.add(int(line))\n-- \n2.20.1.390.gb5101f9297\n\n"},{"id":"390834","messageId":"xmqqv9osbsov.fsf@gitster-ct.c.googlers.com","threadId":"52717","inReplyTo":"20200130115034.6191-2-luke@diamand.org","subject":"Re: [PATCHv1 1/1] git-p4: avoid leak of file handle when cloning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-30T20:22:24Z","receivedAt":"2020-01-30T20:22:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Luke Diamand <luke@diamand.org> writes:\n\n> Spotted by Eric Sunshine:\n>\n>     https://public-inbox.org/git/CAPig+cRx3hG64nuDie69o_gdX39F=sR6D8LyA7J1rCErgu0aMA@mail.gmail.com/\n>\n> Signed-off-by: Luke Diamand <luke@diamand.org>\n> ---\n>  git-p4.py | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n>\n> diff --git a/git-p4.py b/git-p4.py\n> index eb5bc28cf9..9a71a6690d 100755\n> --- a/git-p4.py\n> +++ b/git-p4.py\n> @@ -3563,7 +3563,8 @@ def importRevisions(self, args, branch_arg_given):\n>          changes = []\n>  \n>          if len(self.changesFile) > 0:\n> -            output = open(self.changesFile).readlines()\n> +            with open(self.changesFile) as f:\n> +                output = f.readlines()\n>              changeSet = set()\n>              for line in output:\n>                  changeSet.add(int(line))\n\nI was scratching my head until I realized that this is PATCH 7/6 of\nthe other 6-patch series.\n\nWill queue together with the other ones.  Thanks.\n"}]}