[New-bugs-announce] [issue46096] Support PyObject interface for global variables in local scope and debugger

Dmitry report at bugs.python.org
Thu Dec 16 05:33:14 EST 2021


New submission from Dmitry <Dmitry_Zhamoytsin at mentor.com>:

We use the embedded Python in a multiscript environment. For example, VBS can execute Python code and vice versa. 

For that purpose we use a global context which is common for all running scripts (Python, VBS etc.) and control access to variables in that context by PyObject interface. 

But we faced with an issue:

1) Setting/deleting global variables in local scope are done outside of our control (without using PyObject interface).

2) A debugger (LOAD_NAME tag) does not see global variables in local scope.

We would like to fix that issue by adding a check for exact PyDict (PyDict_CheckExact) in STORE_GLOBAL, DELETE_GLOBAL and LOAD_NAME tags in ceval.c. 
If a global dictionary is redefined then use PyObject interface instead of direct PyDict one.

----------
components: Interpreter Core
hgrepos: 412
messages: 408684
nosy: dzhamoytsin
priority: normal
severity: normal
status: open
title: Support PyObject interface for global variables in local scope and debugger
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46096>
_______________________________________


More information about the New-bugs-announce mailing list