Skip to content

Commit d425fcf

Browse files
authored
Merge branch 'main' into 3.14
2 parents a46aa3e + 853a593 commit d425fcf

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

news/13165.feature.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Speed up small CLI tools by removing ``import re`` from the executable template.
1+
Speed up small CLI tools by removing ``import re`` from the console
2+
script executable template.

news/13329.bugfix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Configured verbosity is consistently forwarded while calling Git during
2+
VCS operations.

news/13329.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

news/13367.feature.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Requires-Python error message now sorts versions numerically.
1+
Requires-Python error message displays version clauses in numerical order.

news/7dab557a-8fb5-41c5-afae-a92c8ab02aba.trivial.rst

Whitespace-only changes.

tests/unit/test_urls.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import sys
3-
import urllib.request
3+
import urllib.parse
44

55
import pytest
66

@@ -11,15 +11,15 @@
1111
def test_path_to_url_unix() -> None:
1212
assert path_to_url("/tmp/file") == "file:///tmp/file"
1313
path = os.path.join(os.getcwd(), "file")
14-
assert path_to_url("file") == "file://" + path
14+
assert path_to_url("file") == "file://" + urllib.parse.quote(path)
1515

1616

1717
@pytest.mark.skipif("sys.platform != 'win32'")
1818
@pytest.mark.parametrize(
1919
"path, url",
2020
[
21-
pytest.param("c:/tmp/file", "file:///C:/tmp/file", id="posix-path"),
22-
pytest.param("c:\\tmp\\file", "file:///C:/tmp/file", id="nt-path"),
21+
pytest.param("C:/tmp/file", "file:///C:/tmp/file", id="posix-path"),
22+
pytest.param("C:\\tmp\\file", "file:///C:/tmp/file", id="nt-path"),
2323
],
2424
)
2525
def test_path_to_url_win(path: str, url: str) -> None:
@@ -38,21 +38,21 @@ def test_unc_path_to_url_win() -> None:
3838

3939
@pytest.mark.skipif("sys.platform != 'win32'")
4040
def test_relative_path_to_url_win() -> None:
41-
resolved_path = os.path.join(os.getcwd(), "file")
42-
assert path_to_url("file") == "file:" + urllib.request.pathname2url(resolved_path)
41+
path = os.path.join(os.getcwd(), "file").replace("\\", "/")
42+
assert path_to_url("file") == "file:///" + urllib.parse.quote(path, safe="/:")
4343

4444

4545
@pytest.mark.parametrize(
4646
"url,win_expected,non_win_expected",
4747
[
4848
("file:tmp", "tmp", "tmp"),
49-
("file:c:/path/to/file", r"C:\path\to\file", "c:/path/to/file"),
49+
("file:C:/path/to/file", r"C:\path\to\file", "C:/path/to/file"),
5050
("file:/path/to/file", r"\path\to\file", "/path/to/file"),
5151
("file://localhost/tmp/file", r"\tmp\file", "/tmp/file"),
52-
("file://localhost/c:/tmp/file", r"C:\tmp\file", "/c:/tmp/file"),
52+
("file://localhost/C:/tmp/file", r"C:\tmp\file", "/C:/tmp/file"),
5353
("file://somehost/tmp/file", r"\\somehost\tmp\file", None),
5454
("file:///tmp/file", r"\tmp\file", "/tmp/file"),
55-
("file:///c:/tmp/file", r"C:\tmp\file", "/c:/tmp/file"),
55+
("file:///C:/tmp/file", r"C:\tmp\file", "/C:/tmp/file"),
5656
],
5757
)
5858
def test_url_to_path(url: str, win_expected: str, non_win_expected: str) -> None:

0 commit comments

Comments
 (0)