[issue33499] Environment variable to set alternate location for pycache tree

Carl Meyer report at bugs.python.org
Tue May 15 22:58:04 EDT 2018


Carl Meyer <carl at oddbird.net> added the comment:

Environment variable seems to make a bit more sense for this, since it's not per-invocation; there's no point writing bytecode cache to a particular location unless the next invocation reads the cache from there.

Our use case includes a webserver process that embeds Python; I'm not sure if we could pass a CLI arg to it or not.

Python has lots of precedent for similar environment variables (e.g. `PYTHONHOME`, `PYTHONDONTWRITEBYTECODE`, `PYTHONPATH`, etc). Compared to those, `PYTHONBYTECODEPATH` is pretty much harmless if it "leaks" to an unintended process.

I asked Brett Cannon in the sprints if I should add a CLI flag in addition to the env var; he suggested it wasn't worth it. I'm not opposed to adding the CLI flag, but I think removing the env var option would be a mistake.

----------

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


More information about the Python-bugs-list mailing list