diff mercurial/debugcommands.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 0b8356705de6
children c4e8fa2b1c40
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Wed Feb 22 10:14:18 2017 -0800
+++ b/mercurial/debugcommands.py	Mon Feb 20 18:40:42 2017 +0530
@@ -692,7 +692,7 @@
     fm = ui.formatter('debugextensions', opts)
     for extname, extmod in sorted(exts, key=operator.itemgetter(0)):
         isinternal = extensions.ismoduleinternal(extmod)
-        extsource = extmod.__file__
+        extsource = pycompat.fsencode(extmod.__file__)
         if isinternal:
             exttestedwith = []  # never expose magic string to users
         else:
@@ -970,7 +970,7 @@
     fm.write('hgmodulepolicy', _("checking module policy (%s)\n"),
              policy.policy)
     fm.write('hgmodules', _("checking installed modules (%s)...\n"),
-             os.path.dirname(__file__))
+             os.path.dirname(pycompat.fsencode(__file__)))
 
     err = None
     try: