Skip to content

Commit 5ac548c

Browse files
committed
Deal with urlunparse() Python 3.12.6 etc. change in parser selection test.
1 parent 990418b commit 5ac548c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/test_parser.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,21 @@ def test_parser_selection():
10841084

10851085
assert parse('file:o') == ('urlp-file', ['file:o'], 'type/file', None)
10861086
assert file_retriever.last_http_accept is None
1087-
assert parse('file:///o') == ('urlp-file', ['file:///o'], 'type/file', None)
1087+
1088+
# this assert is commented because the selected retriever
1089+
# depends on urlunparse() behavior, which in turn depends
1090+
# on the python version (also varies for other major versions):
1091+
#
1092+
# * before 3.12.6: urlunparse(urlparse('file:o')) -> 'file:///o'
1093+
# * starting with 3.12.6: urlunparse(urlparse('file:o')) -> 'file:o'
1094+
#
1095+
# changed in https://github.com/python/cpython/issues/85110
1096+
#
1097+
# https://github.com/pypa/pip/pull/12964
1098+
# says file:whatever is not a valid file: url,
1099+
# TODO: maybe we should check (and fail) for invalid file: urls
1100+
1101+
# assert parse('file:///o') == ('urlp-file', ['file:///o'], 'type/file', None)
10881102

10891103

10901104
def test_retriever_selection():

0 commit comments

Comments
 (0)