Skip to content

inspect module caches can grow without bound #116804

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
encukou opened this issue Mar 14, 2024 · 0 comments
Open

inspect module caches can grow without bound #116804

encukou opened this issue Mar 14, 2024 · 0 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@encukou
Copy link
Member

encukou commented Mar 14, 2024

inspect.getmodule uses these dicts as caches:

modulesbyfile = {}
_filesbymodname = {}

In #116731, we might make refleak tests clear/ignore the caches. But that's not entirely correct: they could grow without bound, with dynamically created files/modules.

@encukou encukou added the stdlib Python modules in the Lib dir label Jan 24, 2025
@picnixz picnixz added the type-bug An unexpected behavior, bug, or error label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants