From e0f2bb42b56f770c50a6ef087e9049fa6ac11fb5 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 5 Nov 2009 23:15:01 +0100 Subject: 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 --- lib/git/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/git/utils.py') 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): -- cgit v1.2.1