You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This effectively disables automatic .pyc file generation and loading of __pycache__ files, which is stronger and more reliable than setting PYTHONDONTWRITEBYTECODE.
Historically, we have supported sys.implementation.cache_tag is None (it's throughout about half the relevant tests), but there's some work to do to get other tests to properly check.
The only build-time option I'm proposing is a preprocessor define that isn't set by default, and when set will set cache_tag to None rather than the default value. Patching in a preprocessor define is much easier to maintain than replacing the code, and I expect anyone who needs this (such as myself) is likely already patching other parts of the source and can easily add a define.
It's actually documented that it may be None, so the fact that we don't handle it is the bug (mostly in tests). Adding the #ifdef with an internal name is hardly a feature.
Activity
zooba commentedon Jan 27, 2026
It's actually documented that it may be None, so the fact that we don't handle it is the bug (mostly in tests). Adding the #ifdef with an internal name is hardly a feature.
pythongh-144278: Enable defining _PY_DISABLE_SYS_CACHE_TAG to disable…
Merge remote-tracking branch 'upstream/main' into pythongh-144278
Merge remote-tracking branch 'upstream/main' into pythongh-144278
Merge remote-tracking branch 'upstream/main' into pythongh-144278
pythongh-144278: Enable overriding TAG in sysmodule.c to change or di…
Merge branch 'main' into pythongh-144278
Merge branch 'main' into pythongh-144278
Merge remote-tracking branch 'upstream/main' into pythongh-144278
Merge remote-tracking branch 'upstream/main' into pythongh-144278
Merge branch 'pythongh-144278' of https://github.com/zooba/cpython into
gh-144278: Enable overriding sys.implementation's name and cache_tag …
pythongh-144278: Enable overriding sys.implementation's name and cach…
pythongh-144278: Enable overriding sys.implementation's name and cach…