diff mercurial/extensions.py @ 31074:2912b06905dc

py3: use pycompat.fsencode() to convert __file__ to bytes __file__ returns unicodes on Python 3. This patch uses pycompat.fsencode() to convert them to bytes.
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 20 Feb 2017 18:40:42 +0530
parents 5ffbaba9acac
children d79761fe697f
line wrap: on
line diff
--- a/mercurial/extensions.py	Wed Feb 22 10:14:18 2017 -0800
+++ b/mercurial/extensions.py	Mon Feb 20 18:40:42 2017 +0530
@@ -362,7 +362,8 @@
     '''find paths of disabled extensions. returns a dict of {name: path}
     removes /__init__.py from packages if strip_init is True'''
     import hgext
-    extpath = os.path.dirname(os.path.abspath(hgext.__file__))
+    extpath = os.path.dirname(
+        os.path.abspath(pycompat.fsencode(hgext.__file__)))
     try: # might not be a filesystem path
         files = os.listdir(extpath)
     except OSError: