[issue40673] urllib.request.URLopener raises different exceptions based on implementation detail

STINNER Victor report at bugs.python.org
Mon May 18 18:16:22 EDT 2020


STINNER Victor <vstinner at python.org> added the comment:

> URLOpener has been deprecated since Python3.3 (https://github.com/python/cpython/blob/master/Lib/urllib/request.py#L1703-L1705) maybe it should just be removed from the codebase?

It emits a DeprecationWarning since at least Python 3.6, so yes, it's now fine to remove the feature. It's also documented as deprecated in:
https://docs.python.org/dev/library/urllib.request.html#urllib.request.URLopener

Maybe we kept it longer than usual because it was common in Python 2.7 to use it, and we tried to keep support for code base compatible with Python 2 and Python 3? I don't know.

I'm fine with removing the class in Python 3.10, but IMO it's too late for Python 3.9 (feature freeze is today).

----------
nosy: +vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40673>
_______________________________________


More information about the Python-bugs-list mailing list