summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib2net.py
diff options
context:
space:
mode:
authorBarney Gale <barney.gale@gmail.com>2024-12-07 17:58:42 (GMT)
committerGitHub <noreply@github.com>2024-12-07 17:58:42 (GMT)
commit79b7cab50a3292a1c01466cf0e69fb7b4e56cfb1 (patch)
tree19605ae130fee6d42c311f29ae51ea1c3887593f /Lib/test/test_urllib2net.py
parent27d0d2141319d82709eb09ba20065df3e1714fab (diff)
downloadcpython-79b7cab50a3292a1c01466cf0e69fb7b4e56cfb1.zip
cpython-79b7cab50a3292a1c01466cf0e69fb7b4e56cfb1.tar.gz
cpython-79b7cab50a3292a1c01466cf0e69fb7b4e56cfb1.tar.bz2
GH-127090: Fix `urllib.response.addinfourl.url` value for opened `file:` URIs (#127091)
The canonical `file:` URL (as generated by `pathname2url()`) is now used as the `url` attribute of the returned `addinfourl` object. The `addinfourl.url` attribute reflects the resolved URL for both `file:` or `http[s]:` URLs now.
Diffstat (limited to 'Lib/test/test_urllib2net.py')
-rw-r--r--Lib/test/test_urllib2net.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py
index f0874d8..b84290a 100644
--- a/Lib/test/test_urllib2net.py
+++ b/Lib/test/test_urllib2net.py
@@ -4,7 +4,6 @@ from test import support
from test.support import os_helper
from test.support import socket_helper
from test.support import ResourceDenied
-from test.test_urllib2 import sanepathname2url
import os
import socket
@@ -151,7 +150,7 @@ class OtherNetworkTests(unittest.TestCase):
f.write('hi there\n')
f.close()
urls = [
- 'file:' + sanepathname2url(os.path.abspath(TESTFN)),
+ 'file:' + urllib.request.pathname2url(os.path.abspath(TESTFN)),
('file:///nonsensename/etc/passwd', None,
urllib.error.URLError),
]