Skip to content

Fix patching of removed URLopener class in Python 3.14#1053

Merged
4383 merged 1 commit intoeventlet:masterfrom
allhailwesttexas:peter/skip-urlopen-patch-if-not-exists
Jun 19, 2025
Merged

Fix patching of removed URLopener class in Python 3.14#1053
4383 merged 1 commit intoeventlet:masterfrom
allhailwesttexas:peter/skip-urlopen-patch-if-not-exists

Conversation

@allhailwesttexas
Copy link
Copy Markdown
Contributor

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.
@allhailwesttexas allhailwesttexas force-pushed the peter/skip-urlopen-patch-if-not-exists branch from aaeb44a to 523a8df Compare June 18, 2025 23:44
@allhailwesttexas allhailwesttexas marked this pull request as ready for review June 18, 2025 23:45
@codecov
Copy link
Copy Markdown

codecov bot commented Jun 19, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 56%. Comparing base (e470c1f) to head (523a8df).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
eventlet/green/urllib/request.py 75% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1053   +/-   ##
======================================
- Coverage      56%     56%   -1%     
======================================
  Files          89      89           
  Lines        9868    9871    +3     
  Branches     1647    1648    +1     
======================================
- Hits         5569    5559   -10     
- Misses       3934    3944   +10     
- Partials      365     368    +3     
Flag Coverage Δ
ipv6 22% <50%> (+<1%) ⬆️
py310asyncio 53% <50%> (-1%) ⬇️
py310epolls 53% <50%> (-1%) ⬇️
py310poll 53% <50%> (+<1%) ⬆️
py310selects 53% <50%> (-1%) ⬇️
py311asyncio 53% <50%> (-1%) ⬇️
py311epolls 53% <50%> (-1%) ⬇️
py312asyncio 50% <50%> (-1%) ⬇️
py312epolls 51% <50%> (-1%) ⬇️
py313asyncio 50% <50%> (-1%) ⬇️
py313epolls 51% <50%> (+<1%) ⬆️
py39asyncio 51% <66%> (-1%) ⬇️
py39dnspython1 51% <66%> (-1%) ⬇️
py39epolls 53% <66%> (-1%) ⬇️
py39openssl 51% <66%> (+<1%) ⬆️
py39poll 53% <66%> (+<1%) ⬆️
py39selects 53% <66%> (-1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@4383 4383 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks

@4383 4383 merged commit 6e9c034 into eventlet:master Jun 19, 2025
23 of 24 checks passed
@4383 4383 mentioned this pull request Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants