[PATCH 1 of 8] py3: make util.datapath a bytes variable

Pulkit Goyal 7895pulkit at gmail.com
Sat Nov 5 23:16:18 UTC 2016


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1478381383 -19800
#      Sun Nov 06 02:59:43 2016 +0530
# Node ID 2d456de3a41ab961da8ae71dfefccdc9d7febe78
# Parent  a19a17a662f669546e75d51ec3b381beb51e737c
py3: make util.datapath a bytes variable

In this patch we make util.datapath a bytes variables.

diff -r a19a17a662f6 -r 2d456de3a41a mercurial/util.py
--- a/mercurial/util.py	Fri Nov 04 20:22:37 2016 -0700
+++ b/mercurial/util.py	Sun Nov 06 02:59:43 2016 +0530
@@ -938,6 +938,9 @@
 else:
     datapath = os.path.dirname(__file__)
 
+if not isinstance(datapath, bytes):
+    datapath = pycompat.fsencode(datapath)
+
 i18n.setdatapath(datapath)
 
 _hgexecutable = None


More information about the Mercurial-devel mailing list