Skip to content

Commit 67fccd5

Browse files
Apply suggestions from code review
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent b5e5460 commit 67fccd5

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

Doc/library/pathlib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ conforming to :rfc:`8089`.
871871

872872
.. versionadded:: 3.13
873873

874-
.. versionchanged:: 3.14
874+
.. versionchanged:: next
875875
If a URL authority (e.g. a hostname) is present and resolves to
876876
``localhost``, it is discarded. If an authority is present and
877877
*doesn't* resolve to ``localhost``, then on Windows a UNC path is

Doc/library/urllib.request.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ The :mod:`urllib.request` module defines the following functions:
181181
>>> url2pathname(url.removeprefix('file:'))
182182
'C:\\Program Files'
183183

184-
.. versionchanged:: 3.14
184+
.. versionchanged:: next
185185
If a URL authority (e.g. a hostname) is present and resolves to
186186
``localhost``, it is discarded. If an authority is present and
187187
*doesn't* resolve to ``localhost``, then on Windows a UNC path is

Lib/urllib/request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ def open_local_file(self, req):
14631463
headers = email.message_from_string(
14641464
'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
14651465
(mtype or 'text/plain', size, modified))
1466-
origurl = 'file:' + pathname2url(localfile)
1466+
origurl = f'file:{pathname2url(localfile)}'
14671467
return addinfourl(open(localfile, 'rb'), headers, origurl)
14681468
except OSError as exp:
14691469
raise URLError(exp, exp.filename)

0 commit comments

Comments
 (0)