Skip to content

Commit ff5e729

Browse files
committed
Address review feedback
1 parent 7183bd6 commit ff5e729

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Lib/nturl2path.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
import warnings
99

1010

11-
warnings._deprecated(__name__, remove=(3, 19))
11+
warnings._deprecated(
12+
__name__,
13+
message=f"{warnings._DEPRECATED_MSG}; use 'urllib.request' instead",
14+
remove=(3, 19))
1215

1316
def url2pathname(url):
1417
"""OS-specific conversion from a relative URL of the 'file' scheme

Lib/urllib/request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,14 +1693,14 @@ def pathname2url(pathname):
16931693
# DOS drive specified. Add three slashes to the start, producing
16941694
# an authority section with a zero-length authority, and a path
16951695
# section starting with a single slash.
1696-
prefix += '///'
1696+
prefix = '///'
16971697
drive = quote(drive, encoding=encoding, errors=errors, safe='/:')
16981698
elif root:
16991699
# Add explicitly empty authority to absolute path. If the path
17001700
# starts with exactly one slash then this change is mostly
17011701
# cosmetic, but if it begins with two or more slashes then this
17021702
# avoids interpreting the path as a URL authority.
1703-
prefix += '//'
1703+
prefix = '//'
17041704
tail = quote(tail, encoding=encoding, errors=errors)
17051705
return prefix + drive + root + tail
17061706

0 commit comments

Comments
 (0)