Patchwork D6033: py3: convert return values of inspect.getabsfile() to bytes

login
register
mail settings
Submitter phabricator
Date Feb. 27, 2019, 10:47 p.m.
Message ID <differential-rev-PHID-DREV-vboq5fmaq3cipy5wpehc-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/38955/
State Superseded
Headers show

Comments

phabricator - Feb. 27, 2019, 10:47 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  It's weird that python docs for inspect does not mention getabsfile().

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6033

AFFECTED FILES
  mercurial/chgserver.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py
--- a/mercurial/chgserver.py
+++ b/mercurial/chgserver.py
@@ -140,7 +140,7 @@ 
     files = [pycompat.sysexecutable]
     for m in modules:
         try:
-            files.append(inspect.getabsfile(m))
+            files.append(pycompat.fsencode(inspect.getabsfile(m)))
         except TypeError:
             pass
     return sorted(set(files))