Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-108732: include comprehension locals in frame.f_locals#109026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
carljm merged 3 commits intopython:mainfromcarljm:framelocals
Sep 7, 2023

Conversation

@carljm
Copy link
Member

@carljmcarljm commentedSep 6, 2023
edited by bedevere-bot
Loading

This applies the same fix that was made forlocals() in#105715 tosys._getframe().f_locals as well. This is mostly relevant because pdb uses the latter, so this fix makes these comprehension locals (in module- or class-scope comprehensions) visible to pdb.

I also made one small fix in passing toPyFrame_FastToLocalsWithError; the assertion and the null check were in the wrong order, since the assertion would segfault before ever hitting the null check, iff were null. (Of course if assertions are turned off, the order doesn't matter either way.)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
@vstinner
Copy link
Member

freebsd Failing

This failure is unrelated to this PR. Apparently, a test_asyncio test is unable on FreeBSD:

FAIL: test_start_tls_server_1 (test.test_asyncio.test_sslproto.SelectorStartTLSTests.test_start_tls_server_1)

I created issue#109051 to track it.

carljm reacted with thumbs up emoji

Copy link
Member

@JelleZijlstraJelleZijlstra left a comment

Choose a reason for hiding this comment

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

Looks good apart from a suggestion in the NEWS entry.

carljm reacted with thumbs up emoji
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@carljmcarljm added the needs backport to 3.12only security fixes labelSep 7, 2023
@carljmcarljm merged commitf2584ea intopython:mainSep 7, 2023
@miss-islington
Copy link
Contributor

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

@carljmcarljm deleted the framelocals branchSeptember 7, 2023 14:56
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 7, 2023
…onGH-109026)(cherry picked from commitf2584ea)Co-authored-by: Carl Meyer <carl@oddbird.net>Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@bedevere-bot
Copy link

GH-109097 is a backport of this pull request to the3.12 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.12only security fixes labelSep 7, 2023
Yhg1s pushed a commit that referenced this pull requestSep 12, 2023
…109026) (#109097)gh-108732: include comprehension locals in frame.f_locals (GH-109026)(cherry picked from commitf2584ea)Co-authored-by: Carl Meyer <carl@oddbird.net>Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@bedevere-bot
Copy link

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

Hi! The buildbotx86 Gentoo Installed with X 3.12 has failed when building commitd533ab1.

What do you need to do:

  1. Don't panic.
  2. Checkthe 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/all/#builders/1136/builds/320) and take a look at the build logs.
  4. Check if the failure is related to this commit (d533ab1) 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/all/#builders/1136/builds/320

Failed tests:

  • test_io

Failed subtests:

  • test_readinto_buffer_overflow - test.test_io.CMiscIOTest.test_readinto_buffer_overflow
  • test_daemon_threads_shutdown_stderr_deadlock - test.test_io.CMiscIOTest.test_daemon_threads_shutdown_stderr_deadlock
  • test_text_encoding - test.test_io.CMiscIOTest.test_text_encoding
  • test_nonblock_pipe_write_bigbuf - test.test_io.PyMiscIOTest.test_nonblock_pipe_write_bigbuf
  • test_daemon_threads_shutdown_stdout_deadlock - test.test_io.CMiscIOTest.test_daemon_threads_shutdown_stdout_deadlock
  • test_text_encoding - test.test_io.PyMiscIOTest.test_text_encoding
  • test_nonblock_pipe_write_bigbuf - test.test_io.CMiscIOTest.test_nonblock_pipe_write_bigbuf
  • test_nonblock_pipe_write_smallbuf - test.test_io.PyMiscIOTest.test_nonblock_pipe_write_smallbuf
  • test_nonblock_pipe_write_smallbuf - test.test_io.CMiscIOTest.test_nonblock_pipe_write_smallbuf

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

==

Click to see traceback logs
Traceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4269, intest_nonblock_pipe_write_bigbufself._test_nonblock_pipe_write(16*1024)  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4308, in_test_nonblock_pipe_write    received.append(rf.read())^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/_pyio.py", line1068, inreadreturnself._read_unlocked(size)^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/_pyio.py", line1080, in_read_unlocked    chunk=self.raw.readall()^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/_pyio.py", line1686, inreadall    result+= chunkMemoryErrorTraceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4275, intest_nonblock_pipe_write_smallbufself._test_nonblock_pipe_write(1024)  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4308, in_test_nonblock_pipe_write    received.append(rf.read())^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/_pyio.py", line1068, inreadreturnself._read_unlocked(size)^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/_pyio.py", line1080, in_read_unlocked    chunk=self.raw.readall()^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/_pyio.py", line1686, inreadall    result+= chunkMemoryErrorTraceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4420, intest_text_encoding    proc= assert_python_ok('-X','utf8=0','-c', code)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/support/script_helper.py", line166, inassert_python_okreturn _assert_python(True,*args,**env_vars)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/support/script_helper.py", line149, in_assert_python    res, cmd_line= run_python_until_end(*args,**env_vars)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/support/script_helper.py", line134, inrun_python_until_end    proc= subprocess.Popen(cmd_line,stdin=subprocess.PIPE,^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/subprocess.py", line1026, in__init__self._execute_child(args, executable, preexec_fn, close_fds,  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/subprocess.py", line1906, in_execute_child    part= os.read(errpipe_read,50000)^^^^^^^^^^^^^^^^^^^^^^^^^^^^MemoryErrorTraceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4269, intest_nonblock_pipe_write_bigbufself._test_nonblock_pipe_write(16*1024)  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4308, in_test_nonblock_pipe_write    received.append(rf.read())^^^^^^^^^MemoryErrorTraceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4301, in_test_nonblock_pipe_write    wf.write(msg)BlockingIOError:[Errno 12] write could not complete without blockingTraceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4305, in_test_nonblock_pipe_writeself.assertEqual(e.args[0], errno.EAGAIN)AssertionError:12 != 11Traceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4437, intest_readinto_buffer_overflowself.assertRaises(ValueError, bufio.readinto, b)  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/unittest/case.py", line778, inassertRaisesreturn context.handle('assertRaises', args, kwargs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/unittest/case.py", line238, inhandle    callable_obj(*args,**kwargs)  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4434, inreadreturnb'x'*10**6~~~~~^~~~~~~MemoryErrorTraceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4269, intest_nonblock_pipe_write_bigbufself._test_nonblock_pipe_write(16*1024)  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4294, in_test_nonblock_pipe_writewith rf, wf:BlockingIOError:[Errno 11] write could not complete without blockingTraceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4483, intest_daemon_threads_shutdown_stdout_deadlockself.check_daemon_threads_shutdown_deadlock('stdout')  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4467, incheck_daemon_threads_shutdown_deadlock    res, _= run_python_until_end("-c", code)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/support/script_helper.py", line134, inrun_python_until_end    proc= subprocess.Popen(cmd_line,stdin=subprocess.PIPE,^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/subprocess.py", line1026, in__init__self._execute_child(args, executable, preexec_fn, close_fds,  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/subprocess.py", line1906, in_execute_child    part= os.read(errpipe_read,50000)^^^^^^^^^^^^^^^^^^^^^^^^^^^^MemoryErrorTraceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4488, intest_daemon_threads_shutdown_stderr_deadlockself.check_daemon_threads_shutdown_deadlock('stderr')  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4467, incheck_daemon_threads_shutdown_deadlock    res, _= run_python_until_end("-c", code)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/support/script_helper.py", line139, inrun_python_until_end    out, err= proc.communicate()^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/subprocess.py", line1209, incommunicate    stdout, stderr=self._communicate(input, endtime, timeout)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/subprocess.py", line2128, in_communicate    data= os.read(key.fd,32768)^^^^^^^^^^^^^^^^^^^^^^MemoryErrorTraceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4275, intest_nonblock_pipe_write_smallbufself._test_nonblock_pipe_write(1024)  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_io.py", line4308, in_test_nonblock_pipe_write    received.append(rf.read())^^^^^^^^^MemoryError

@bedevere-bot
Copy link

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

Hi! The buildbotx86 Gentoo Non-Debug with X 3.12 has failed when building commitd533ab1.

What do you need to do:

  1. Don't panic.
  2. Checkthe 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/all/#builders/1191/builds/317) and take a look at the build logs.
  4. Check if the failure is related to this commit (d533ab1) 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/all/#builders/1191/builds/317

Failed tests:

  • test_io

Failed subtests:

  • test_readinto_buffer_overflow - test.test_io.CMiscIOTest.test_readinto_buffer_overflow
  • test_daemon_threads_shutdown_stderr_deadlock - test.test_io.CMiscIOTest.test_daemon_threads_shutdown_stderr_deadlock
  • test_text_encoding - test.test_io.CMiscIOTest.test_text_encoding
  • test_daemon_threads_shutdown_stdout_deadlock - test.test_io.CMiscIOTest.test_daemon_threads_shutdown_stdout_deadlock
  • test_nonblock_pipe_write_bigbuf - test.test_io.CMiscIOTest.test_nonblock_pipe_write_bigbuf
  • test_nonblock_pipe_write_smallbuf - test.test_io.CMiscIOTest.test_nonblock_pipe_write_smallbuf

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

==

Click to see traceback logs
Traceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/test_io.py", line4437, intest_readinto_buffer_overflowself.assertRaises(ValueError, bufio.readinto, b)  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/unittest/case.py", line778, inassertRaisesreturn context.handle('assertRaises', args, kwargs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/unittest/case.py", line238, inhandle    callable_obj(*args,**kwargs)  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/test_io.py", line4434, inreadreturnb'x'*10**6~~~~~^~~~~~~MemoryErrorTraceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/test_io.py", line4420, intest_text_encoding    proc= assert_python_ok('-X','utf8=0','-c', code)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/support/script_helper.py", line166, inassert_python_okreturn _assert_python(True,*args,**env_vars)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/support/script_helper.py", line149, in_assert_python    res, cmd_line= run_python_until_end(*args,**env_vars)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/support/script_helper.py", line134, inrun_python_until_end    proc= subprocess.Popen(cmd_line,stdin=subprocess.PIPE,^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/subprocess.py", line1026, in__init__self._execute_child(args, executable, preexec_fn, close_fds,  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/subprocess.py", line1906, in_execute_child    part= os.read(errpipe_read,50000)^^^^^^^^^^^^^^^^^^^^^^^^^^^^MemoryErrorTraceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/test_io.py", line4488, intest_daemon_threads_shutdown_stderr_deadlockself.check_daemon_threads_shutdown_deadlock('stderr')  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/test_io.py", line4467, incheck_daemon_threads_shutdown_deadlock    res, _= run_python_until_end("-c", code)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/support/script_helper.py", line139, inrun_python_until_end    out, err= proc.communicate()^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/subprocess.py", line1209, incommunicate    stdout, stderr=self._communicate(input, endtime, timeout)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/subprocess.py", line2128, in_communicate    data= os.read(key.fd,32768)^^^^^^^^^^^^^^^^^^^^^^MemoryErrorTraceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/test_io.py", line4269, intest_nonblock_pipe_write_bigbufself._test_nonblock_pipe_write(16*1024)  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/test_io.py", line4308, in_test_nonblock_pipe_write    received.append(rf.read())^^^^^^^^^MemoryErrorTraceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/test_io.py", line4483, intest_daemon_threads_shutdown_stdout_deadlockself.check_daemon_threads_shutdown_deadlock('stdout')  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/test_io.py", line4467, incheck_daemon_threads_shutdown_deadlock    res, _= run_python_until_end("-c", code)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/support/script_helper.py", line134, inrun_python_until_end    proc= subprocess.Popen(cmd_line,stdin=subprocess.PIPE,^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/subprocess.py", line1026, in__init__self._execute_child(args, executable, preexec_fn, close_fds,  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/subprocess.py", line1906, in_execute_child    part= os.read(errpipe_read,50000)^^^^^^^^^^^^^^^^^^^^^^^^^^^^MemoryErrorTraceback (most recent call last):  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/test_io.py", line4275, intest_nonblock_pipe_write_smallbufself._test_nonblock_pipe_write(1024)  File"/buildbot/buildarea/cpython/3.12.ware-gentoo-x86.nondebug/build/Lib/test/test_io.py", line4308, in_test_nonblock_pipe_write    received.append(rf.read())^^^^^^^^^MemoryError

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra approved these changes

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

+1 more reviewer

@chgnrdvchgnrdvchgnrdv left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@carljm@vstinner@miss-islington@bedevere-bot@JelleZijlstra@chgnrdv

[8]ページ先頭

©2009-2025 Movatter.jp