GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-138151: Fix annotationlib handling of multiple nonlocals by JelleZijlstra · Pull Request #138164 · python/cpython

Conversation

@JelleZijlstra

@JelleZijlstra JelleZijlstra commented Aug 26, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: annotationlib: ref.evaluate() not working for generics as local variables #138151

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JelleZijlstra
pythongh-138151: Fix annotationlib handling of multiple nonlocals
1c86ad9
@bedevere-app bedevere-app Bot added the awaiting core review label Aug 26, 2025
@JelleZijlstra JelleZijlstra added needs backport to 3.14 bugs and security fixes and removed awaiting core review labels Aug 26, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Aug 26, 2025
annotationlib: ref.evaluate() not working for generics as local variables #138151
Closed
@StanFromIreland StanFromIreland added the awaiting core review label Aug 26, 2025
@JelleZijlstra JelleZijlstra mentioned this pull request Sep 6, 2025
gh-138151: Fix ForwardRef.evaluate() for locally defined generics #138161
Closed
@JelleZijlstra
Merge branch 'main' into annolib-nonlocal
26ef202
@JelleZijlstra
JelleZijlstra merged commit b1027d4 into python:main Nov 3, 2025
4 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Nov 3, 2025

Copy link
Copy Markdown

Thanks @JelleZijlstra for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting core review label Nov 3, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 3, 2025
@JelleZijlstra @miss-islington
pythongh-138151: Fix annotationlib handling of multiple nonlocals (py…
321c693
…thonGH-138164)

(cherry picked from commit b1027d4)

Co-authored-by: Jelle Zijlstra <[email protected]>
@bedevere-app

bedevere-app Bot commented Nov 3, 2025

Copy link
Copy Markdown

GH-140949 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Nov 3, 2025
JelleZijlstra added a commit that referenced this pull request Nov 3, 2025
@miss-islington @JelleZijlstra
[3.14] gh-138151: Fix annotationlib handling of multiple nonlocals (G…
08012a9
…H-138164) (#140949)

gh-138151: Fix annotationlib handling of multiple nonlocals (GH-138164)
(cherry picked from commit b1027d4)

Co-authored-by: Jelle Zijlstra <[email protected]>
@bedevere-bot

bedevere-bot commented Nov 3, 2025

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM64 macOS 3.14 (tier-2) has failed when building commit 08012a9.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1772/builds/668) and take a look at the build logs.
  4. Check if the failure is related to this commit (08012a9) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1772/builds/668

Failed tests:

  • test_urllib2net

Failed subtests:

  • test_ftp - test.test_urllib2net.OtherNetworkTests.test_ftp

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/urllib/request.py", line 1546, in ftp_open
    fp, retrlen = fw.retrfile(file, type)
                  ~~~~~~~~~~~^^^^^^^^^^^^
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/urllib/request.py", line 1806, in retrfile
    conn, retrlen = self.ftp.ntransfercmd(cmd)
                    ~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/ftplib.py", line 354, in ntransfercmd
    conn = socket.create_connection((host, port), self.timeout,
                                    source_address=self.source_address)
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 870, in create_connection
    raise exceptions[0]
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 855, in create_connection
    sock.connect(sa)
    ~~~~~~~~~~~~^^^^
TimeoutError: timed out


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_urllib2net.py", line 260, in _test_urls
    f = urlopen(url, req, support.INTERNET_TIMEOUT)
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_urllib2net.py", line 28, in wrapped
    return _retry_thrice(func, exc, *args, **kwargs)
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_urllib2net.py", line 24, in _retry_thrice
    raise last_exc
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_urllib2net.py", line 20, in _retry_thrice
    return func(*args, **kwargs)
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/urllib/request.py", line 487, in open
    response = self._open(req, data)
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/urllib/request.py", line 504, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/urllib/request.py", line 464, in _call_chain
    result = func(*args)
  File "/Users/buildbot/buildarea/3.14.pablogsal-macos-m1.macos-with-brew/build/Lib/urllib/request.py", line 1556, in ftp_open
    raise URLError(f"ftp error: {exp}") from exp
urllib.error.URLError: <urlopen error ftp error: timed out>
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Nov 4, 2025
gh-137969: Fix double evaluation of ForwardRefs which rely on globals #140974
Merged
annotationlib: ref.evaluate(format=Format.FORWARDREF) returns a ForwardRef with a copied __globals__ that no longer updates #137969
Closed
@Viicos Viicos mentioned this pull request Dec 3, 2025
Remove xfail marker on a PEP 649 related test pydantic/pydantic#12609
Merged
5 tasks
Viicos added a commit to pydantic/pydantic that referenced this pull request Dec 4, 2025
@Viicos
Remove xfail marker on a PEP 649 related test (#12609)
53cb5f8
Thanks to python/cpython#138164 (included in 3.14.1), Python is now able to preserve references when building the forward ref object, and so calling `_eval_type()` on the individual annotations works as expected.
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
@JelleZijlstra @StanFromIreland
pythongh-138151: Fix annotationlib handling of multiple nonlocals (py…
552abfa
…thon#138164)
@Glinte Glinte mentioned this pull request Jan 13, 2026
[Bug] CPython 3.14.2 + PEP 649 annotationlib.ForwardRef + PEP 484 self-reference = TypeError: unhashable type: 'cell' 😨 beartype/beartype#610
Closed
@johnslavik johnslavik mentioned this pull request Jan 14, 2026
Python 3.14.1+ annotationlib regression: ForwardRef.__hash__ raises TypeError: unhashable type: 'cell' #143831
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@JelleZijlstra @bedevere-bot @StanFromIreland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.