This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lunixbochs2
Recipients Mark.Shannon, ammar2, christian.heimes, lunixbochs2, steve.dower, vstinner
Date 2021-01-21.14:39:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1611239962.41.0.899782592953.issue42800@roundup.psfhosted.org>
In-reply-to
Content
My personal motivation is not to unilaterally prevent access to globals, but to close a simpler gap in the audit system that affects a currently deployed high performance production system (which is not trying to be a sandbox). I am also already using a C audit hook for my purposes.

If you are referencing vstinner's first message, please remember to read their follow up https://bugs.python.org/msg384988 where they seem to have changed their mind in support of the patch.

The audit attributes I'm chasing here are fairly small in scope, and overwhelmingly only used in debug code. I believe adding them is in the spirit of the original PEP. I have also done extensive testing and CPython C and stdlib code analysis as part of this effort.

If you agree with the original PEP authors that __code__ and sys._getframe() are worth auditing, then I believe this is a natural extension of that concept. My patch improves upon the PEP by increasing the audit coverage to every way I can see of getting a frame and code object from basic CPython types.

This is a simple patch with clear performance metrics. I don't see any reason to expand the scope of this in the future unless CPython adds another basic object type along the same lines (e.g. a new async function type, a new traceback type, or a new frame type).
History
Date User Action Args
2021-01-21 14:39:22lunixbochs2setrecipients: + lunixbochs2, vstinner, christian.heimes, Mark.Shannon, steve.dower, ammar2
2021-01-21 14:39:22lunixbochs2setmessageid: <1611239962.41.0.899782592953.issue42800@roundup.psfhosted.org>
2021-01-21 14:39:22lunixbochs2linkissue42800 messages
2021-01-21 14:39:21lunixbochs2create