[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've filed [Homebrew/brew#7204](https://github.com/Homebrew/brew/issues/7204) to track the testing/validation of this change against Homebrew. -- ___ Python tracker

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread Jason R. Coombs
Change by Jason R. Coombs : -- versions: +Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread Jason R. Coombs
Change by Jason R. Coombs : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread Jason R. Coombs
Jason R. Coombs added the comment: New changeset 5765acaf64cc2c52ce8a35de9407faddf6885598 by Jason R. Coombs in branch '3.7': [3.7] bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516) (GH-19111)

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread Jason R. Coombs
Jason R. Coombs added the comment: New changeset c959fa9353b92ce95dd7fe3f25fe65bacbe22338 by Miss Islington (bot) in branch '3.8': bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516) (GH-19110)

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread Jason R. Coombs
Change by Jason R. Coombs : -- pull_requests: +18472 pull_request: https://github.com/python/cpython/pull/19111 ___ Python tracker ___

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread Jason R. Coombs
Jason R. Coombs added the comment: New changeset 044cf94f610e831464a69a8e713dad89878824ce by Ronald Oussoren in branch 'master': bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516) https://github.com/python/cpython/commit/044cf94f610e831464a69a8e713dad89878824ce

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2020-03-22 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +18471 pull_request: https://github.com/python/cpython/pull/19110 ___ Python tracker

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2019-05-17 Thread Cheryl Sabella
Cheryl Sabella added the comment: It looks like @ronaldoussoren's pull request was ready to go pending a test with Brew. The PR itself needs a rebase, but is anyone able to finish the testing on this for it to be merged? Thanks! -- nosy: +cheryl.sabella versions: +Python 3.7,

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2019-03-22 Thread Anders Hovmöller
Anders Hovmöller added the comment: I just discovered this ticket again and see that it's stuck! I have read through the thread but it's still a bit unclear what would be required to test this with homebrew like Guido says is needed for this to go forward. Is there anyone who can explain or

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2018-09-24 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks, I have confirmed that this reproduces our issue and that your PR fixes it. I guess at this point we need someone to test with Brew. -- ___ Python tracker

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2018-09-23 Thread Ronald Oussoren
Ronald Oussoren added the comment: I had the some problem when using mypy. What does reproduce the issue is the following: * Create *two* venv environments * Install mypy in one of them * Activate the other * Run the subprocess call in the activated venv I then get a message about not being

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2018-09-23 Thread Guido van Rossum
Guido van Rossum added the comment: I would love to know how to repro the original bug so I can demonstrate this actually fixes it. Here's what I think should be the repro: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -c 'import subprocess; p =

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2018-09-23 Thread Ronald Oussoren
Ronald Oussoren added the comment: I've added back port labels for 3.6 and 3.7. AFAIK 3.5 is closed for bugfixes at this point (except for security fixes). -- ___ Python tracker

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2018-09-23 Thread Guido van Rossum
Guido van Rossum added the comment: Jason if you could test this we would be grateful! Ronald what do you think of marking this as backportable to 3.7, 3.6 and 3.5? -- ___ Python tracker

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2018-09-23 Thread Ronald Oussoren
Ronald Oussoren added the comment: To use the framework build you either have to install, use or set "DYLD_FRAMEWORK_PATH" in the environment (See the definition of RUNFORSHARED in Makefile for the value to use). To properly test the this issue you have to install (or trick the system into

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2018-09-23 Thread Jason R. Coombs
Jason R. Coombs added the comment: Is it documented anywhere how to do a framework build of Python? When I try to do a framework build by running `./configure --enable-framework` then `make`, `./python.exe` emits the following: dyld: Library not loaded:

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2018-09-23 Thread Ronald Oussoren
Ronald Oussoren added the comment: I've added PR 9516 that just clears __PYVENV_LAUNCHER__ from the environment as soon as it is no longer needed. A more involved change would be to change both the interpreter and the stub executable to avoid the need to use an environment variable in the

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2018-09-23 Thread Ronald Oussoren
Change by Ronald Oussoren : -- pull_requests: +8922 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2018-09-23 Thread Ronald Oussoren
Ronald Oussoren added the comment: The pull request is wrong, the use of __PYVENV_LAUNCHER__ in pythonw.c is correct and should not be removed. Where the current code goes wrong is that it doesn't clear the environment as soon as possible. This patch should basically do the trick (but

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2018-09-22 Thread Jason R. Coombs
Jason R. Coombs added the comment: I went naively through the codebase and removed every reference to PYVENV_LAUNCHER and submitted as PR 9498. Does the CI runner at https://python.visualstudio.com/cpython/_build/results?buildId=31019=logs use a framework build such that it's an adequate

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2018-09-22 Thread Jason R. Coombs
Change by Jason R. Coombs : -- pull_requests: +8905 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2018-09-22 Thread Vinay Sajip
Vinay Sajip added the comment: As I said in msg284106, it seems that the __PYVENV_LAUNCHER__ should be removed from the stub launcher and then tests should confirm that framework builds aren't adversely affected. Unfortunately, I can't do this testing as I don't have a Mac, and have been

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2018-09-21 Thread Guido van Rossum
Guido van Rossum added the comment: I was pointed here after we found some erroneous behavior. We have a script run by the system python that invokes a specific venv's python3 with a -m flag requesting a module that is installed (only) in that venv. A user complained that this failed, with

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2017-11-25 Thread Anders Hovmöller
Change by Anders Hovmöller : -- nosy: +Anders.Hovmöller ___ Python tracker ___ ___

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2017-11-25 Thread Anders Hovmöller
Change by Anders Hovmöller : -- versions: +Python 3.6 ___ Python tracker ___ ___

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2016-12-31 Thread Vinay Sajip
Vinay Sajip added the comment: > I tried making a Framework build of Python with the environment variable > removed entirely, but I'm not experienced enough with builds on a Mac to know > what I need to do to create a proper build. Given Jason's comment above, it's probably best for one of

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2016-12-27 Thread Jason R. Coombs
Jason R. Coombs added the comment: That also looks good. $ head -n1 ~/.envs/issue22490/bin/cherryd #!/Users/jaraco/.envs/issue22490/bin/python -- ___ Python tracker

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2016-12-27 Thread Vinay Sajip
Vinay Sajip added the comment: Thanks. It's worth checking what shebang was written to a script that was installed into the venv - e.g. cherryd. -- ___ Python tracker

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2016-12-27 Thread Jason R. Coombs
Jason R. Coombs added the comment: On Python 3.6, I made the edit. I actually used the one-liner ` os.environ.pop('__PYVENV_LAUNCHER__', None)`. I then created a venv and installed a package and successfully ran a module in that package: $ python -m venv ~/.envs/issue22490-test $

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2016-12-27 Thread Vinay Sajip
Vinay Sajip added the comment: I'm not sure if msg230947 is still correct, and it seems neater to remove __PYVENV_LAUNCHER__ from where it's defined in the first place (the stub launcher C file) if it was just a shim needed around the time the functionality was developed (pre the 3.3

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2016-12-22 Thread Tim Smith
Tim Smith added the comment: Since __PYVENV_LAUNCHER__ is consulted in site.py, it seems likely that the latest it can be deleted is in site.py. The attached patch does that. -- Added file: http://bugs.python.org/file46004/delete-venev-launcher.diff

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2016-12-22 Thread Tim Smith
Tim Smith added the comment: I spoke prematurely; I recently rediscovered that the persistence of __PYVENV_LAUNCHER__ poisons the sys.executable of virtualenv interpreters launched as a subprocess of another Python interpreter: $ virtualenv -p python3 test $ test/bin/python3 -c 'import sys;

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2016-01-20 Thread Jason R. Coombs
Jason R. Coombs added the comment: I believe this behavior (presence of the __PYVENV_LAUNCHER__ and inheritance in child processes) continues to cause problems. See https://github.com/pypa/virtualenv/issues/845 for a simple reproducing of the issue, even on pip 6+. -- nosy:

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2015-01-18 Thread Tim Smith
Tim Smith added the comment: Homebrew's interest in this ticket was resolved by the release of pip 6, which includes Vinay's change to distlib to use sys.executable instead of __PYVENV_LAUNCHER__. Many thanks! I'm not marking this fixed in case it is useful to leave this open to discuss

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-11-10 Thread Ronald Oussoren
Ronald Oussoren added the comment: The environment variable itself cannot be removed from CPython, it is necessary to implement the correct behavior of pyvenv with framework builds of Python. That said, I do think that the environment variable should be unset as soon as possible in the

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-11-09 Thread Vinay Sajip
Vinay Sajip added the comment: I don't quite understand why you use __PYVENV_LAUNCHER__ When I first developed the venv functionality it was definitely needed, but it looks as if it is not needed now. Perhaps to fix this completely, the following needs to be done, on the assumption that

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-10-19 Thread Ronald Oussoren
Ronald Oussoren added the comment: First of all, sorry about the slow response. Vinay: I don't quite understand why you use __PYVENV_LAUNCHER__: When I create a pyvenv using python 3.3 (with a oldish build from the 3.3 branch) sys.executable point to a binary in the venv without mucking with

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-10-12 Thread Ned Deily
Ned Deily added the comment: A comment on Vinay's comment: and this cannot be obtained from sys.executable because that is pointing to a framework executable. That *was* true prior to 3.3 and is still true at the moment for 2.7.x but it is not true for 3.3+. Ronald's change (b79d276041a8)

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-10-12 Thread Vinay Sajip
Vinay Sajip added the comment: Ronald's change ... changed the stub launcher to no longer do a realpath() on the executable name which means that sys.executable contains the path to the Python stub launcher whether or not in a venv Ronald's change doesn't do a realpath() on the executable

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-10-12 Thread Tim Smith
Tim Smith added the comment: We would like to refer to python3 as /usr/local/opt/python3/bin/python3, where /usr/local/opt/python3 is a symlink to ../Cellar/python3/3.4.2, and /usr/local/Cellar/python3/3.4.2/bin/python3 is a symlink to

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-10-11 Thread Tim Smith
Tim Smith added the comment: I'm attaching an updated patch; it passes tests for me locally with a framework build. -- Added file: http://bugs.python.org/file36885/dont-realpath-venv-dirname.diff-1 ___ Python tracker rep...@bugs.python.org

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-10-11 Thread Tim Smith
Tim Smith added the comment: Er, because the test has been modified by taking Vinay's suggestion to test that the directories are physically identical instead of doing a string comparison. -- ___ Python tracker rep...@bugs.python.org

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-09-25 Thread Ned Deily
Ned Deily added the comment: From the initial description of the problem, it's not clear to me that there is a problem here needing resolution in the stub launcher. I've asked for clarification on the pip issue tracker. -- ___ Python tracker

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-09-25 Thread Ned Deily
Ned Deily added the comment: Also, the patch causes a test failure with a framework build: == FAIL: test_defaults (test.test_venv.BasicTest) -- Traceback (most

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-09-25 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'm not convinced that this is a bug in python. __PYVENV_LAUNCHER__ is an implementation detail of CPython used in the implementation of the pyvenv functionality. I consider using this undocumented environment variable in distlib as a bug in distlib, which

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-09-25 Thread Ronald Oussoren
Ronald Oussoren added the comment: On 25 sep. 2014, at 19:58, Ronald Oussoren rep...@bugs.python.org wrote: Ronald Oussoren added the comment: I consider using this undocumented environment variable in distlib as a bug in distlib, which should be fixed Speaking of which... That

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-09-25 Thread Vinay Sajip
Vinay Sajip added the comment: I consider using this undocumented environment variable in distlib as a bug in distlib, which should be fixed there. Well, let me explain why it's used: when Python = 3.3 starts up, it looks for a pyvenv.cfg file proximate to sys.executable. If found, that

[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2014-09-24 Thread Tim Smith
New submission from Tim Smith: Homebrew, the OS X package manager, distributes python3 as a framework build. We like to be able to control the shebang that gets written to scripts installed with pip. [1] The path we prefer for invoking the python3 interpreter is like