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-120097: Make FrameLocalsProxy a mapping by markshannon · Pull Request #120101 · python/cpython

Conversation

@markshannon

@markshannon markshannon commented Jun 5, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Issue: FrameLocalsProxy is not a mapping #120097

Sorry, something went wrong.

Uh oh!

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

All reactions
markshannon added 2 commits June 5, 2024 10:31
@markshannon
Make FrameLocalsProxy subclass collections.abc.Mapping
3bdabf1
@markshannon
add news
ca491ef
@markshannon
markshannon requested a review from rhettinger as a code owner June 5, 2024 09:35
@bedevere-app bedevere-app Bot added the awaiting core review label Jun 5, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Jun 5, 2024
FrameLocalsProxy is not a mapping #120097
Closed
@markshannon markshannon changed the title GH-120097: Make locals proxy mapping GH-120097: Make FrameLocalsProxy a mapping Jun 5, 2024
sobolevn
sobolevn reviewed Jun 5, 2024
View reviewed changes
Comment thread Lib/_collections_abc.py Resolved

Uh oh!

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

Comment thread Lib/test/test_frame.py
copy.deepcopy(d)

def test_is_mapping(self):
x = 1

@sobolevn sobolevn Jun 5, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Why do you need x? To fill f_locals? In this case I propose to use a inner function. Or maybe two: with and without locals.

Sorry, something went wrong.

Uh oh!

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

All reactions

@markshannon markshannon Jun 7, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The contents are irrelevant, but we want something just to make sure we are testing the right thing.
Without x = 1, the locals would just be {} and it would be too easy to mistakenly test the wrong mapping.

Sorry, something went wrong.

Uh oh!

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

All reactions
sobolevn
sobolevn reviewed Jun 5, 2024
View reviewed changes
Comment thread Lib/_collections_abc.py Resolved

Uh oh!

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

@markshannon @sobolevn
Update Lib/_collections_abc.py
544090d
Co-authored-by: Nikita Sobolev <[email protected]>
@markshannon
markshannon requested a review from gaogaotiantian June 7, 2024 15:54
@markshannon
Fix renaming
d25a8b3
@gaogaotiantian

gaogaotiantian commented Jun 10, 2024

Copy link
Copy Markdown
Member

Is the test failure related?

All reactions

Sorry, something went wrong.

Uh oh!

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

iritkatriel
iritkatriel approved these changes Jun 19, 2024
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Jun 19, 2024
@markshannon
markshannon merged commit d1c673b into python:main Jun 19, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Jun 19, 2024
@AlexWaygood AlexWaygood added the needs backport to 3.13 only security fixes label Jun 19, 2024
@miss-islington-app

miss-islington-app Bot commented Jun 19, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 19, 2024
@markshannon @miss-islington
pythonGH-120097: Make FrameLocalsProxy a mapping (pythonGH-120101)
7b1502e
* Register FrameLocalsProxy as a subclass of collections.abc.Mapping

* Allow FrameLocalsProxy to matching mapping patterns
(cherry picked from commit d1c673b)

Co-authored-by: Mark Shannon <[email protected]>
@bedevere-app

bedevere-app Bot commented Jun 19, 2024

Copy link
Copy Markdown

GH-120749 is a backport of this pull request to the 3.13 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.13 only security fixes label Jun 19, 2024
mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
@markshannon @mrahtz
pythonGH-120097: Make FrameLocalsProxy a mapping (python#120101)
5639472
* Register FrameLocalsProxy as a subclass of collections.abc.Mapping

* Allow FrameLocalsProxy to matching mapping patterns
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
@markshannon @estyxx
pythonGH-120097: Make FrameLocalsProxy a mapping (python#120101)
b3a69be
* Register FrameLocalsProxy as a subclass of collections.abc.Mapping

* Allow FrameLocalsProxy to matching mapping patterns
@markshannon
markshannon deleted the make-locals-proxy-mapping branch August 6, 2024 10:15
markshannon pushed a commit that referenced this pull request Aug 23, 2024
@miss-islington @ncoghlan
[3.13] GH-120097: Make FrameLocalsProxy a mapping (GH-120101) (GH-120749
95b4f9c
)

Co-authored-by: Alyssa Coghlan <[email protected]>
@bedevere-bot

bedevere-bot commented Aug 23, 2024

Copy link
Copy Markdown

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

Hi! The buildbot iOS ARM64 Simulator 3.13 has failed when building commit 95b4f9c.

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/1386/builds/503) and take a look at the build logs.
  4. Check if the failure is related to this commit (95b4f9c) 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/1386/builds/503

Failed tests:

  • test_socketserver

Failed subtests:

  • test_UnixDatagramServer - test.test_socketserver.SocketServerTest.test_UnixDatagramServer
  • test_ThreadingUnixDatagramServer - test.test_socketserver.SocketServerTest.test_ThreadingUnixDatagramServer

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
    self.run()
    ~~~~~~~~^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/threading.py", line 992, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 694, in process_request_thread
    self.handle_error(request, client_address)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 692, in process_request_thread
    self.finish_request(request, client_address)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 362, in finish_request
    self.RequestHandlerClass(request, client_address, self)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 763, in __init__
    self.finish()
    ~~~~~~~~~~~^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 858, in finish
    self.socket.sendto(self.wfile.getvalue(), self.client_address)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ConnectionResetError: [Errno 54] Connection reset by peer
Warning -- threading_cleanup() failed to clean up threads in 1.0 seconds
Warning --   before: thread count=0, dangling=1
Warning --   after: thread count=1, dangling=4
Warning -- Dangling thread: <_MainThread(MainThread, started 4366598720)>
Warning -- Dangling thread: <Thread(Thread-2873 (process_request_thread), stopped 6137769984)>
Warning -- Dangling thread: <Thread(<class 'socketserver.ThreadingUnixDatagramServer'> serving, started daemon 6120943616)>
Warning -- Dangling thread: <Thread(Thread-2874 (process_request_thread), stopped 6154596352)>
ERROR


Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 228, in test_ThreadingUnixDatagramServer
    self.run_server(socketserver.ThreadingUnixDatagramServer,
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    socketserver.DatagramRequestHandler,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    self.dgram_examine)
                    ^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/test/support/threading_helper.py", line 66, in decorator
    return func(*args)
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 133, in run_server
    testfunc(svrcls.address_family, addr)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 160, in dgram_examine
    buf = data = receive(s, 100)
                 ~~~~~~~^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 43, in receive
    raise RuntimeError("timed out on %r" % (sock,))
RuntimeError: timed out on <socket.socket fd=33, family=1, type=2, proto=0, laddr=./test_python__imgs0_7.sock>


Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
    self.run()
    ~~~~~~~~^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/threading.py", line 992, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 240, in serve_forever
    self._handle_request_noblock()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 320, in _handle_request_noblock
    self.handle_error(request, client_address)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 318, in _handle_request_noblock
    self.process_request(request, client_address)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 349, in process_request
    self.finish_request(request, client_address)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 362, in finish_request
    self.RequestHandlerClass(request, client_address, self)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 763, in __init__
    self.finish()
    ~~~~~~~~~~~^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 858, in finish
    self.socket.sendto(self.wfile.getvalue(), self.client_address)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ConnectionResetError: [Errno 54] Connection reset by peer
ERROR


Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 222, in test_UnixDatagramServer
    self.run_server(socketserver.UnixDatagramServer,
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    socketserver.DatagramRequestHandler,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    self.dgram_examine)
                    ^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/test/support/threading_helper.py", line 66, in decorator
    return func(*args)
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 133, in run_server
    testfunc(svrcls.address_family, addr)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 160, in dgram_examine
    buf = data = receive(s, 100)
                 ~~~~~~~^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/F4BBB41D-5207-4016-951B-2DC02AC8DD0F/data/Containers/Bundle/Application/150C37C0-A406-4BC6-B95F-53E7B448E825/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 43, in receive
    raise RuntimeError("timed out on %r" % (sock,))
RuntimeError: timed out on <socket.socket fd=34, family=1, type=2, proto=0, laddr=./test_python_sow1nfse.sock>
All reactions

Sorry, something went wrong.

Uh oh!

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

@gaogaotiantian gaogaotiantian mentioned this pull request Jul 12, 2025
FrameLocalsProxy (PEP 667) is not registered as a subclass of abc.Mapping #136492
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sobolevn sobolevn sobolevn left review comments
@iritkatriel iritkatriel iritkatriel approved these changes
@rhettinger rhettinger Awaiting requested review from rhettinger rhettinger is a code owner
@gaogaotiantian gaogaotiantian Awaiting requested review from gaogaotiantian

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.

6 participants

@markshannon @gaogaotiantian @bedevere-bot @iritkatriel @sobolevn @AlexWaygood
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.