changeset 44641:e74af49aa3c9

url: pass str to pathname2url This is needed to appease Python 3. This fixes test-extdata.t and test-url-download.t on Python 3 on Windows. Differential Revision: https://phab.mercurial-scm.org/D8335
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 28 Mar 2020 13:12:43 -0700
parents 51ffb2a6c08a
children da9b7f9635a2
files mercurial/url.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/url.py	Sat Mar 28 09:21:46 2020 -0700
+++ b/mercurial/url.py	Sat Mar 28 13:12:43 2020 -0700
@@ -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