[PATCH STABLE] openpath: specify binary mode and use util.posixfile

Adrian Buehlmann adrian at cadifra.com
Thu Nov 1 07:47:59 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1351773963 -3600
# Branch stable
# Node ID a6464c0f7624c40dcb75eab27ff1c7bc598ba2d4
# Parent  1aab870bbedfe0b173a4d8c5edaeb2ce5ddf6eff
openpath: specify binary mode and use util.posixfile

follow-up to 0e2846b2482c

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -92,7 +92,7 @@
 def openpath(ui, path):
     '''open path with open if local, url.open if remote'''
     if islocal(path):
-        return open(util.urllocalpath(path))
+        return util.posixfile(util.urllocalpath(path), 'rb')
     else:
         return url.open(ui, path)
 


More information about the Mercurial-devel mailing list