diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-07-11 18:44:23 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-07-11 18:44:23 +0200 |
commit | 55b67e8194b8b4d9e73e27feadbf9af6593e4600 (patch) | |
tree | da3bca26a634fac2903f9654286e05f49c41c974 /lib/git | |
parent | de3b9639a4c2933ebb0f11ad288514cda83c54fe (diff) | |
download | gitpython-55b67e8194b8b4d9e73e27feadbf9af6593e4600.tar.gz |
Fixed python < 2.6 windows specific issue when reading in the index using a memory map. Its totally ridiculous, but fixed
Diffstat (limited to 'lib/git')
-rw-r--r-- | lib/git/index/base.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/git/index/base.py b/lib/git/index/base.py index 0f02352f..5011a932 100644 --- a/lib/git/index/base.py +++ b/lib/git/index/base.py @@ -124,7 +124,13 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): return # END exception handling - stream = file_contents_ro(fd, stream=True, allow_mmap=True) + # Here it comes: on windows in python 2.5, memory maps aren't closed properly + # Hence we are in trouble if we try to delete a file that is memory mapped, + # which happens during read-tree. + # In this case, we will just read the memory in directly. + # Its insanely bad ... I am disappointed ! + allow_mmap = (os.name != 'nt' or sys.version_info[1] > 5) + stream = file_contents_ro(fd, stream=True, allow_mmap=allow_mmap) try: self._deserialize(stream) |