# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2016-12-17 19:14:21 # Node ID c6026c20a3ce8b7612033f1a45315750dc91a863 # Parent ce36fa9b140cff93e071035e3e9d4aaf39e6f7b0 py3: have a bytes version of os.altsep os.altsep returns unicodes on Python 3. We need a bytes version hence added pycompat.altsep. diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py --- a/mercurial/pycompat.py +++ b/mercurial/pycompat.py @@ -44,6 +44,9 @@ if ispy3: osname = os.name.encode('ascii') ospathsep = os.pathsep.encode('ascii') ossep = os.sep.encode('ascii') + osaltsep = os.altsep + if osaltsep: + osaltsep = osaltsep.encode('ascii') # os.getcwd() on Python 3 returns string, but it has os.getcwdb() which # returns bytes. getcwd = os.getcwdb @@ -145,6 +148,7 @@ else: osname = os.name ospathsep = os.pathsep ossep = os.sep + osaltsep = os.altsep stdin = sys.stdin stdout = sys.stdout stderr = sys.stderr