From: Lukasz Kosewski Date: Mon, 15 Mar 2010 03:17:42 +0000 (-0400) Subject: lib/bup/index.py: mmap.mmap() objects need to be closed() for Win32. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8d6d1bb9f483f786127d11c4d5397c189fc977a8;p=packages%2Fb%2Fbup.git lib/bup/index.py: mmap.mmap() objects need to be closed() for Win32. Not *entirely* sure why this is the case, but it appears through some refcounting weirdness, just setting the mmap variables to None in index.Readers doesn't cause the mmap to be freed under Cygwin, though I can't find any reason why this would be the case. Naturally, this caused all sort of pain when we attempt to unlink an mmaped file created while running bup index --check -u. Fix the issue by explicitly .close()ing the mmap in Reader.close(). --- diff --git a/lib/bup/index.py b/lib/bup/index.py index 8aea5c4..1c555d7 100644 --- a/lib/bup/index.py +++ b/lib/bup/index.py @@ -293,6 +293,7 @@ class Reader: def close(self): self.save() if self.writable and self.m: + self.m.close() self.m = None self.writable = False