Skip to content

Commit

Permalink
Windows test fixes python#7, also fix missing docs ref
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Oct 30, 2024
1 parent 26db297 commit 7584b65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions Doc/library/urllib.request.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,11 @@ The :mod:`urllib.request` module defines the following functions:
Convert the percent-encoded *url* to a local pathname.

.. versionchanged:: 3.14
Supports :rfc:`8089`-compliant file URLs. Raises :exc:`URLError` if a
scheme other than ``file:`` is used. If the URL uses a non-local
authority, then on Windows a UNC path is returned, and on other
platforms a :exc:`URLError` exception is raised.
Supports :rfc:`8089`-compliant file URLs. Raises
:exc:`~urllib.error.URLError` if a scheme other than ``file:`` is used.
If the URL uses a non-local authority, then on Windows a UNC path is
returned, and on other platforms a :exc:`~urllib.error.URLError`
exception is raised.


.. function:: getproxies()
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_urllib2.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ def test_file(self):
"file://localhost%s" % urlpath,
"file://%s" % urlpath,
]
if os.name == 'nt':
if os.name != 'nt':
urls.append("file://%s%s" % (socket.gethostbyname('localhost'), urlpath))
try:
localaddr = socket.gethostbyname(socket.gethostname())
Expand Down

0 comments on commit 7584b65

Please sign in to comment.