Skip to content

Commit 7584b65

Browse files
committed
Windows test fixes python#7, also fix missing docs ref
1 parent 26db297 commit 7584b65

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Doc/library/urllib.request.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,11 @@ The :mod:`urllib.request` module defines the following functions:
169169
Convert the percent-encoded *url* to a local pathname.
170170

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

177178

178179
.. function:: getproxies()

Lib/test/test_urllib2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ def test_file(self):
824824
"file://localhost%s" % urlpath,
825825
"file://%s" % urlpath,
826826
]
827-
if os.name == 'nt':
827+
if os.name != 'nt':
828828
urls.append("file://%s%s" % (socket.gethostbyname('localhost'), urlpath))
829829
try:
830830
localaddr = socket.gethostbyname(socket.gethostname())

0 commit comments

Comments
 (0)