From patchwork Wed Nov 2 22:23:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [5,of,7] py3: make scmutil.rcpath() return bytes From: Pulkit Goyal <7895pulkit@gmail.com> X-Patchwork-Id: 17302 Message-Id: <9e259e7b59b6358eb842.1478125390@pulkit-goyal> To: mercurial-devel@mercurial-scm.org Date: Thu, 03 Nov 2016 03:53:10 +0530 # HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1478120266 -19800 # Thu Nov 03 02:27:46 2016 +0530 # Node ID 9e259e7b59b6358eb842eabbc99f4c18a4cc5009 # Parent e0e794c3b580b1f64d37ccdd6d8bd606eb87880e py3: make scmutil.rcpath() return bytes In the whole series we are dealing with path varaibles which must be bytes on UNIX. 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 e0e794c3b580 -r 9e259e7b59b6 mercurial/scmutil.py --- a/mercurial/scmutil.py Thu Nov 03 02:17:01 2016 +0530 +++ b/mercurial/scmutil.py Thu Nov 03 02:27:46 2016 +0530 @@ -755,7 +755,8 @@ if _rcpath is None: if 'HGRCPATH' in encoding.environ: _rcpath = [] - for p in os.environ['HGRCPATH'].split(os.pathsep): + pathsep = os.pathsep.encode('ascii') + for p in encoding.environ['HGRCPATH'].split(pathsep): if not p: continue p = util.expandpath(p)