[issue46096] Support PyObject interface for global variables in local scope and debugger

2021-12-16 Thread Dmitry


Change by Dmitry :


--
keywords: +patch
pull_requests: +28359
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30141

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46096] Support PyObject interface for global variables in local scope and debugger

2021-12-16 Thread Dmitry


New submission from Dmitry :

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com