Rev 4857: Explicitly call stream.close() in the index code. in http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-close-file-handles

John Arbash Meinel john at arbash-meinel.com
Wed Dec 2 17:59:23 GMT 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-close-file-handles

------------------------------------------------------------
revno: 4857
revision-id: john at arbash-meinel.com-20091202175915-me81n1ovkuml4ake
parent: john at arbash-meinel.com-20091202175617-v7np8euc44nx5lji
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1.0b4-close-file-handles
timestamp: Wed 2009-12-02 11:59:15 -0600
message:
  Explicitly call stream.close() in the index code.
  
  This isn't in a finally block, but it is 'good enough'. At least .close is
  being called rather than waiting for the garbage collector to run.
-------------- next part --------------
=== modified file 'bzrlib/index.py'
--- a/bzrlib/index.py	2009-12-01 16:03:14 +0000
+++ b/bzrlib/index.py	2009-12-02 17:59:15 +0000
@@ -455,6 +455,7 @@
         trailers = 0
         pos = stream.tell()
         lines = stream.read().split('\n')
+        stream.close()
         del lines[-1]
         _, _, _, trailers = self._parse_lines(lines, pos)
         for key, absent, references, value in self._keys_by_offset.itervalues():



More information about the bazaar-commits mailing list