Patchwork D8335: url: pass str to pathname2url

login
register
mail settings
Submitter phabricator
Date March 29, 2020, 1:40 a.m.
Message ID <differential-rev-PHID-DREV-isgybah2hganudq7btbs-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/45924/
State Superseded
Headers show

Comments

phabricator - March 29, 2020, 1:40 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is needed to appease Python 3.
  
  This fixes test-extdata.t and test-url-download.t on Python 3
  on Windows.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/url.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/url.py b/mercurial/url.py
--- a/mercurial/url.py
+++ b/mercurial/url.py
@@ -674,7 +674,9 @@ 
         url_, authinfo = u.authinfo()
     else:
         path = util.normpath(os.path.abspath(url_))
-        url_ = b'file://' + pycompat.bytesurl(urlreq.pathname2url(path))
+        url_ = b'file://' + pycompat.bytesurl(
+            urlreq.pathname2url(pycompat.fsdecode(path))
+        )
         authinfo = None
     return opener(ui, authinfo, sendaccept=sendaccept).open(
         pycompat.strurl(url_), data