summaryrefslogtreecommitdiff
path: root/lib/git/index
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-07-11 18:44:23 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-07-11 18:44:23 +0200
commit55b67e8194b8b4d9e73e27feadbf9af6593e4600 (patch)
treeda3bca26a634fac2903f9654286e05f49c41c974 /lib/git/index
parentde3b9639a4c2933ebb0f11ad288514cda83c54fe (diff)
downloadgitpython-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/index')
-rw-r--r--lib/git/index/base.py8
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)