Mercurial > hg
comparison mercurial/url.py @ 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 | 9d2b2df2c2ba |
children | a50f33f1ff24 |
comparison
equal
deleted
inserted
replaced
44640:51ffb2a6c08a | 44641:e74af49aa3c9 |
---|---|
672 if u.scheme: | 672 if u.scheme: |
673 u.scheme = u.scheme.lower() | 673 u.scheme = u.scheme.lower() |
674 url_, authinfo = u.authinfo() | 674 url_, authinfo = u.authinfo() |
675 else: | 675 else: |
676 path = util.normpath(os.path.abspath(url_)) | 676 path = util.normpath(os.path.abspath(url_)) |
677 url_ = b'file://' + pycompat.bytesurl(urlreq.pathname2url(path)) | 677 url_ = b'file://' + pycompat.bytesurl( |
678 urlreq.pathname2url(pycompat.fsdecode(path)) | |
679 ) | |
678 authinfo = None | 680 authinfo = None |
679 return opener(ui, authinfo, sendaccept=sendaccept).open( | 681 return opener(ui, authinfo, sendaccept=sendaccept).open( |
680 pycompat.strurl(url_), data | 682 pycompat.strurl(url_), data |
681 ) | 683 ) |
682 | 684 |