# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1478386039 -19800 # Node ID af7c60988f6ed469d857099d676a051d7b9d0c6b # Parent ba2c04059317fc144581b58a432e21f6c8d54492 py3: make scmutil.rcpath() return bytes This patch make sure scmutil.rcpath() returns bytes independent of which platform is used on Python 3. If we want to change type for windows we can just conditionalize the return variable. diff -r ba2c04059317 -r af7c60988f6e mercurial/scmutil.py --- a/mercurial/scmutil.py Sun Nov 06 04:10:33 2016 +0530 +++ b/mercurial/scmutil.py Sun Nov 06 04:17:19 2016 +0530 @@ -27,6 +27,7 @@ osutil, pathutil, phases, + pycompat, revset, similar, util, @@ -755,7 +756,7 @@ if _rcpath is None: if 'HGRCPATH' in encoding.environ: _rcpath = [] - for p in os.environ['HGRCPATH'].split(os.pathsep): + for p in encoding.environ['HGRCPATH'].split(pycompat.ospathsep): if not p: continue p = util.expandpath(p) diff -r ba2c04059317 -r af7c60988f6e tests/test-check-py3-commands.t --- a/tests/test-check-py3-commands.t Sun Nov 06 04:10:33 2016 +0530 +++ b/tests/test-check-py3-commands.t Sun Nov 06 04:17:19 2016 +0530 @@ -9,6 +9,6 @@ > $PYTHON3 `which hg` $cmd 2>&1 2>&1 | tail -1 > done version - TypeError: str expected, not bytes + TypeError: startswith first arg must be str or a tuple of str, not bytes debuginstall - TypeError: str expected, not bytes + TypeError: startswith first arg must be str or a tuple of str, not bytes