summaryrefslogtreecommitdiff
path: root/lib/git/utils.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-11-05 23:15:01 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-11-05 23:22:11 +0100
commite0f2bb42b56f770c50a6ef087e9049fa6ac11fb5 (patch)
treef8cf67c8cd7f7340c3f2f6f9959d69a1fe1a8773 /lib/git/utils.py
parent819d6aceeb4d31c153de58081b21ad4f8b559c0e (diff)
downloadgitpython-e0f2bb42b56f770c50a6ef087e9049fa6ac11fb5.tar.gz
ARGH: wb and rb is not the same as r and w on windows, hence reading of binary files went crazy as well as binary writing
Diffstat (limited to 'lib/git/utils.py')
-rw-r--r--lib/git/utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/git/utils.py b/lib/git/utils.py
index 4397fbb2..5deed556 100644
--- a/lib/git/utils.py
+++ b/lib/git/utils.py
@@ -131,7 +131,7 @@ class LockFile(object):
lock_file = self._lock_file_path()
try:
- fp = open(lock_file, "r")
+ fp = open(lock_file, "rb")
pid = int(fp.read())
fp.close()
except IOError:
@@ -156,7 +156,7 @@ class LockFile(object):
if os.path.exists(lock_file):
raise IOError("Lock for file %r did already exist, delete %r in case the lock is illegal" % (self._file_path, lock_file))
- fp = open(lock_file, "w")
+ fp = open(lock_file, "wb")
fp.write(str(os.getpid()))
fp.close()
@@ -212,7 +212,7 @@ class ConcurrentWriteOperation(LockFile):
self._obtain_lock_or_raise()
dirname, basename = os.path.split(self._file_path)
- self._temp_write_fp = open(tempfile.mktemp(basename, '', dirname), "w")
+ self._temp_write_fp = open(tempfile.mktemp(basename, '', dirname), "wb")
return self._temp_write_fp
def _is_writing(self):