Show More
@@ -373,8 +373,8 b' class mutablebasepack(versionmixin):' | |||
|
373 | 373 | suffix=self.PACKSUFFIX + '-tmp') |
|
374 | 374 | self.idxfp, self.idxpath = opener.mkstemp( |
|
375 | 375 | suffix=self.INDEXSUFFIX + '-tmp') |
|
376 | self.packfp = os.fdopen(self.packfp, r'w+') | |
|
377 | self.idxfp = os.fdopen(self.idxfp, r'w+') | |
|
376 | self.packfp = os.fdopen(self.packfp, r'wb+') | |
|
377 | self.idxfp = os.fdopen(self.idxfp, r'wb+') | |
|
378 | 378 | self.sha = hashlib.sha1() |
|
379 | 379 | self._closed = False |
|
380 | 380 |
@@ -255,7 +255,7 b' class basestore(object):' | |||
|
255 | 255 | they want to be kept alive in the store. |
|
256 | 256 | """ |
|
257 | 257 | repospath = os.path.join(self._path, "repos") |
|
258 | with open(repospath, 'a') as reposfile: | |
|
258 | with open(repospath, 'ab') as reposfile: | |
|
259 | 259 | reposfile.write(os.path.dirname(path) + "\n") |
|
260 | 260 | |
|
261 | 261 | repospathstat = os.stat(repospath) |
@@ -270,7 +270,7 b' class basestore(object):' | |||
|
270 | 270 | return True |
|
271 | 271 | |
|
272 | 272 | if self._validatecachelog: |
|
273 | with open(self._validatecachelog, 'a+') as f: | |
|
273 | with open(self._validatecachelog, 'ab+') as f: | |
|
274 | 274 | f.write("corrupt %s during %s\n" % (path, action)) |
|
275 | 275 | |
|
276 | 276 | os.rename(path, path + ".corrupt") |
@@ -176,7 +176,7 b' def _decompressblob(raw):' | |||
|
176 | 176 | |
|
177 | 177 | def parsefileblob(path, decompress): |
|
178 | 178 | raw = None |
|
179 | f = open(path, "r") | |
|
179 | f = open(path, "rb") | |
|
180 | 180 | try: |
|
181 | 181 | raw = f.read() |
|
182 | 182 | finally: |
@@ -482,7 +482,7 b' class fileserverclient(object):' | |||
|
482 | 482 | |
|
483 | 483 | def close(self): |
|
484 | 484 | if fetches: |
|
485 |
msg = ("% |
|
|
485 | msg = ("%d files fetched over %d fetches - " + | |
|
486 | 486 | "(%d misses, %0.2f%% hit ratio) over %0.2fs\n") % ( |
|
487 | 487 | fetched, |
|
488 | 488 | fetches, |
@@ -234,7 +234,7 b' def _loadfileblob(repo, cachepath, path,' | |||
|
234 | 234 | |
|
235 | 235 | f = None |
|
236 | 236 | try: |
|
237 | f = util.atomictempfile(filecachepath, "w") | |
|
237 | f = util.atomictempfile(filecachepath, "wb") | |
|
238 | 238 | f.write(text) |
|
239 | 239 | except (IOError, OSError): |
|
240 | 240 | # Don't abort if the user only has permission to read, |
@@ -246,7 +246,7 b' def _loadfileblob(repo, cachepath, path,' | |||
|
246 | 246 | finally: |
|
247 | 247 | os.umask(oldumask) |
|
248 | 248 | else: |
|
249 | with open(filecachepath, "r") as f: | |
|
249 | with open(filecachepath, "rb") as f: | |
|
250 | 250 | text = f.read() |
|
251 | 251 | return text |
|
252 | 252 |
General Comments 0
You need to be logged in to leave comments.
Login now