jelmer/dulwich — pull request #186 by garyvdm (2014-06-01 21:06:25+00:00)
Title: Close all files. 

Python 3.4 add as new feature that emits a warning if a file object gets deleted or garbage collected before it is closed.

Running the test suite under 3.4, I was getting a lot of these warnings. This patch fixes all of these warnings.

In addition, it also fixes a bunch of errors I was getting when running the test suite under wine, similar to:

======================================================================
ERROR: test_simple (dulwich.tests.test_porcelain.PullTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Python27\lib\shutil.py", line 250, in rmtree
onerror(os.remove, fullname, sys.exc_info())
File "C:\Python27\lib\shutil.py", line 248, in rmtree
os.remove(fullname)
WindowsError: [Error 32] Sharing violation: 'c:\\users\\garyvdm\\temp\\tmpabr7v1\\tmpa3bguj'