comparison hgext/patchbomb.py @ 5752:84a6e463b948

patchbomb: read bundle file in binary mode
author Patrick Mezard <pmezard@gmail.com>
date Fri, 28 Dec 2007 16:41:40 +0100
parents eae4553b2763
children ea1016b32e94
comparison
equal deleted inserted replaced
5672:8a65ea986755 5752:84a6e463b948
218 def getbundle(dest): 218 def getbundle(dest):
219 tmpdir = tempfile.mkdtemp(prefix='hg-email-bundle-') 219 tmpdir = tempfile.mkdtemp(prefix='hg-email-bundle-')
220 tmpfn = os.path.join(tmpdir, 'bundle') 220 tmpfn = os.path.join(tmpdir, 'bundle')
221 try: 221 try:
222 commands.bundle(ui, repo, tmpfn, dest, **opts) 222 commands.bundle(ui, repo, tmpfn, dest, **opts)
223 return open(tmpfn).read() 223 return open(tmpfn, 'rb').read()
224 finally: 224 finally:
225 try: 225 try:
226 os.unlink(tmpfn) 226 os.unlink(tmpfn)
227 except: 227 except:
228 pass 228 pass