Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue47204

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Ensure PyEval_GetGlobals() doesn't set an exception when returning NULL
Type:enhancementStage:test needed
Components:Versions:
process
Status:openResolution:
Dependencies:Superseder:
Assigned To: ncoghlanNosy List: ncoghlan
Priority:normalKeywords:

Created on2022-04-03 06:41 byncoghlan, last changed2022-04-11 14:59 byadmin.

Messages (2)
msg416611 -(view)Author: Alyssa Coghlan (ncoghlan)*(Python committer)Date: 2022-04-03 06:41
While working on the first PR forbpo-44800 I provoked an obscure failure in PyImport_ImportModule by making PyEval_GetGlobals set an exception when returning NULL (as PyEval_GetLocals has done sincebpo-18408 was implemented for Python 3.4).This ticket covers adding an embedding test case that:* ensures PyEval_GetGlobals() returns NULL without an exception when no Python frame is active* ensures PyEval_GetLocals() returns NULL and sets an exception when no Python frame is active* ensures PyImport_ImportModule still works when no Python frame is activeThere's an option to slightly change the behaviour of `PyEval_GetLocals()` to NOT set an exception in the "no Python frame" case, and instead only set the error when there is a Python frame, but something goes wrong when attempting to access the fast locals array (such as a memory allocation failure).
msg416612 -(view)Author: Alyssa Coghlan (ncoghlan)*(Python committer)Date: 2022-04-03 06:48
Core dev forum thread for the C API question:https://discuss.python.org/t/subtle-c-api-discrepancy-pyeval-getlocals-vs-pyeval-getglobals-with-no-python-frame/14797
History
DateUserActionArgs
2022-04-11 14:59:58adminsetgithub: 91360
2022-04-03 06:48:44ncoghlansetmessages: +msg416612
2022-04-03 06:41:46ncoghlancreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp