This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xtreak
Recipients cheryl.sabella, xtreak
Date 2019-05-17.16:09:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558109392.44.0.978961343501.issue36948@roundup.psfhosted.org>
In-reply-to
Content
In issue27485 the deprecated functions were replaced with underscore prefixed ones due to which imports where modified. Some of the places where not changed causing NameError in using urllib.request.URLopener.retrieve for local files and non-local files which is deprecated. I found these undefined names while running flake8 on Lib folder. I will raise a PR with tests for the same.

Sample Error : 

./python.exe
Python 3.8.0a4+ (heads/master:870b035bc6, May 17 2019, 16:28:23)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.request import URLopener
>>> URLopener().retrieve('file:///tmp/a.txt')
sys:1: DeprecationWarning: URLopener style of invoking requests is deprecated. Use newer urlopen functions/methods
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/urllib/request.py", line 1786, in retrieve
    return url2pathname(splithost(url1)[1]), hdrs
NameError: name 'splithost' is not defined
History
Date User Action Args
2019-05-17 16:09:52xtreaksetrecipients: + xtreak, cheryl.sabella
2019-05-17 16:09:52xtreaksetmessageid: <1558109392.44.0.978961343501.issue36948@roundup.psfhosted.org>
2019-05-17 16:09:52xtreaklinkissue36948 messages
2019-05-17 16:09:52xtreakcreate