GH-84850: Remove urllib.request.URLopener and FancyURLopener#125739
GH-84850: Remove urllib.request.URLopener and FancyURLopener#125739hugovk merged 5 commits intopython:mainfrom
urllib.request.URLopener and FancyURLopener#125739Conversation
These classes have been deprecated since Python 3.3.
|
A code search on PyPI top 8,000 projects (at 2024-10-16) on
I didn't check the code to see if imports are conditionals on Python <= 3.3 or not. I ignored Detailscc @hugovk |
|
Thanks Victor. From that list, I think about 6 packages are using |
|
I believe only four packages would break for users if we removed these classes:
I'll work on PRs if the package authors seem interested. |
|
I've submitted PRs against the three projects, one of which has been accepted already. They're all simple changes - in Python 2 terms, we're upgrading from Given that 3.14 is still around a year away, and only 3 projects in 8,000 are affected and possible to remedy at this stage, I submit that we don't need to wait for the other two PRs. Thoughts? |
Agreed, this is definitely on the low side. |
The class urllib.request.URLopener has been removed in Python 3.14: python/cpython#125739 Because of this, trying to run the tests in `test__greenness.py` fails with the following on Python 3.14: ``` ERROR tests/test__greenness.py - NameError: name 'URLopener' is not defined ``` Update the patching so that we only do it for Python versions lower than 3.14.
The class urllib.request.URLopener has been removed in Python 3.14: python/cpython#125739 Because of this, trying to run the tests in `test__greenness.py` fails with the following on Python 3.14: ``` ERROR tests/test__greenness.py - NameError: name 'URLopener' is not defined ``` Update the patching so that we only do it for Python versions lower than 3.14.
The class urllib.request.URLopener has been removed in Python 3.14: python/cpython#125739 Because of this, trying to run the tests in `test__greenness.py` fails with the following on Python 3.14: ``` ERROR tests/test__greenness.py - NameError: name 'URLopener' is not defined ``` Update the patching so that we only do it for Python versions lower than 3.14. More details: https://docs.python.org/3/library/urllib.request.html#urllib.request.URLopener
These classes have been deprecated since Python 3.3. They originate in Python 2's
urllib, whereas most of the rest of this module comes fromurllib2.📚 Documentation preview 📚: https://cpython-previews--125739.org.readthedocs.build/