# HG changeset patch # User Gregory Szorc # Date 2020-03-28 20:12:43 # Node ID e74af49aa3c9dba8f5329853f91d4a160e461f84 # Parent 51ffb2a6c08a7e525a573932d37a35db93199170 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 diff --git a/mercurial/url.py b/mercurial/url.py --- a/mercurial/url.py +++ b/mercurial/url.py @@ -674,7 +674,9 @@ def open(ui, url_, data=None, sendaccept 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