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

2018-08-01 Thread STINNER Victor
STINNER Victor added the comment: New changeset fc96437db4fa95dff99d43d4500beaf12bad5bff by Victor Stinner in branch 'master': bpo-33499: Fix pymain_init_pycache_prefix() (GH-8596) https://github.com/python/cpython/commit/fc96437db4fa95dff99d43d4500beaf12bad5bff -- nosy: +vstinner

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

2018-07-31 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +8106 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2018-06-20 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 16eb3bcdb22be4d82dc597b92b7154fcb11c6479 by Nick Coghlan in branch 'master': bpo-33499: PYTHONPYCACHEPREFIX What's New entry (GH-7749) https://github.com/python/cpython/commit/16eb3bcdb22be4d82dc597b92b7154fcb11c6479 --

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

2018-06-15 Thread Nick Coghlan
Change by Nick Coghlan : -- pull_requests: +7357 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2018-06-15 Thread Nick Coghlan
Nick Coghlan added the comment: Merged as PYTHONPYCACHEPREFIX=path, -X pycache_prefix=path and sys.pycache_prefix :) I'll also update PEP 304 with a note saying a variant of the idea was eventually accepted for Python 3.8. -- resolution: -> fixed stage: patch review -> resolved

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

2018-06-15 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset b193fa996a746111252156f11fb14c12fd6267e6 by Nick Coghlan (Carl Meyer) in branch 'master': bpo-33499: Add PYTHONPYCACHEPREFIX env var for alt bytecode cache location. (GH-6834)

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

2018-05-18 Thread Carl Meyer
Carl Meyer added the comment: Cool, thanks for the pointer on -X. PR is updated with `-X bytecode_path=PATH`; don't think it's critical to have it, but it wasn't that hard to add. -- ___ Python tracker

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

2018-05-17 Thread Nick Coghlan
Nick Coghlan added the comment: I believe the main argument for -X options is the fact that cmd on Windows doesn't offer a nice way of setting environment variables as part of the command invocation (hence "-X utf8", for example). As far as setting values for X options

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

2018-05-17 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Honestly, I don't think there's a strong argument for a CLI option. I'm perfectly happy with just an environment variable. -- ___ Python tracker

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

2018-05-17 Thread Carl Meyer
Carl Meyer added the comment: Can we have a named -X option that also takes a parameter? I don't see any existing examples of that. This option needs to take the path where bytecode should be written. Are there strong use-cases for having a CLI arg for this? I don't mind

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

2018-05-17 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On May 17, 2018, at 08:14, Nick Coghlan wrote: > > If we did add an option, then a named -X option would probably make the most > sense. +1 -- ___ Python tracker

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

2018-05-17 Thread Nick Coghlan
Nick Coghlan added the comment: Regarding environment variables, note that they get used in two *very* different ways: 1. The "persistent shell setting" case that Raymond describes. While setting PYTHONBYTECODEPATH to always point to a RAM disk could make quite a bit of

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

2018-05-16 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On May 15, 2018, at 22:58, Carl Meyer wrote: > 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. I think you pretty much have to have an

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

2018-05-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Environment variables aren't system-wide, they are > per-process (though they can be inherited by child processes). Yes, that is how they work. It is not how they are used. Environment variables are commonly set in shell

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

2018-05-15 Thread Carl Meyer
Carl Meyer added the comment: > a system-wide environment variable Environment variables aren't system-wide, they are per-process (though they can be inherited by child processes). -- ___ Python tracker

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

2018-05-15 Thread Carl Meyer
Carl Meyer 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

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

2018-05-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I've had issues with environment variables in that they affect every version of Python running on a system and seem to defy isolation. So, if one application needs the environment variable set, it will affect every

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

2018-05-15 Thread Łukasz Langa
Change by Łukasz Langa : -- versions: +Python 3.8 ___ Python tracker ___ ___

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

2018-05-14 Thread Carl Meyer
Change by Carl Meyer : -- keywords: +patch pull_requests: +6517 stage: -> patch review ___ Python tracker ___

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

2018-05-14 Thread Carl Meyer
Carl Meyer added the comment: Per vstinner Python prefers to not have underscores in environment variable names, for historical reasons. So I'm using `PYTHONBYTECODEPATH` as the env var. Other open questions: 1) Does there need to be a corresponding CLI flag, or is

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

2018-05-14 Thread Barry A. Warsaw
Change by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list

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

2018-05-14 Thread Carl Meyer
New submission from Carl Meyer : We would like to set an environment variable that would cause Python to read and write `__pycache__` directories from a separate location on the filesystem (outside the source code tree). We have two reasons for this: 1. In our development