[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2019-04-25 Thread STINNER Victor
STINNER Victor added the comment: New changeset f4edd39017a211d4544570a1e2ac2110ef8e51b4 by Victor Stinner in branch '2.7': bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875) (GH-12949) https://github.com/python/cpython/commit/f4edd39017a211d4544570a1e2ac2110ef8e51b4 --

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2019-04-25 Thread STINNER Victor
STINNER Victor added the comment: New changeset 3076a3e0d1c54a2a6cc54c84521cd0f640d7cffb by Victor Stinner (Miss Islington (bot)) in branch '3.7': bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875) (GH-12948) https://github.com/python/cpython/commit/3076a3e0d1c54a2a6cc54c

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2019-04-25 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +12875 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2019-04-25 Thread miss-islington
Change by miss-islington : -- pull_requests: +12873 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2019-04-25 Thread STINNER Victor
STINNER Victor added the comment: New changeset 0ef8c157e9195df0115c54ba875a5efb92ac22fb by Victor Stinner in branch 'master': bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875) https://github.com/python/cpython/commit/0ef8c157e9195df0115c54ba875a5efb92ac22fb --

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2019-04-18 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +12800 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2012-10-08 Thread Chris Jerdonek
Chris Jerdonek added the comment: I just created issue 16170 about a newly-added subprocess.Popen() test that succeeds on Windows and Mac but fails on Linux. It seems closely related to the issue discussed here. Perhaps it signals an underlying issue that needs to be fixed. -- nosy:

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-21 Thread STINNER Victor
STINNER Victor added the comment: The initial problem (test_subprocess failures) is solved thanks to different fixes. I consider that we can close this issue. Use non portable tricks to get the real program name if argv[0] is invalid doesn't sound like something importat. If someone changes a

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-21 Thread STINNER Victor
STINNER Victor added the comment: > r78835 (trunk) fixes getpath Backport done: r79202 (2.6). -- ___ Python tracker ___ ___ Python-bu

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-14 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-12 Thread STINNER Victor
STINNER Victor added the comment: > r78835 (trunk) fixes getpath and includes also a fix for sysconfig which > should fix test_executable_with_cwd() of test_subprocess. Backported as r78868 to the py3k branch. -- ___ Python tracker

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-11 Thread STINNER Victor
STINNER Victor added the comment: Oh well, it's really hard to test the tests in my working copy because it depends on a lot of factors: the current working directory, is Python installed or not, the OS, etc. The test introduced in r78835 was incorrect (only the test, the fix is correct): r78

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-11 Thread STINNER Victor
Changes by STINNER Victor : -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/op

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-11 Thread STINNER Victor
STINNER Victor added the comment: There is a 4th case about sys.executable: If argv[0] is an empty string, Python search the absolute path of "python" (hardcoded program name). The result is /usr/bin/python in my Linux box, whereas the real program name should be /opt/pythontrunk/bin/python.

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-11 Thread STINNER Victor
STINNER Victor added the comment: r78835 (trunk) fixes getpath and includes also a fix for sysconfig which should fix test_executable_with_cwd() of test_subprocess. My fix on sysconfig is different than flox's patch: since I fixed getpath, sys.executable cannot be a directory name. At revisio

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-11 Thread STINNER Victor
STINNER Victor added the comment: getpath.patch: another patch written by flox. If argv[0] is set to a non existent program name, sys.executable is set to an empty string instead of a directory name. Example of the bug with Python 2.5: $ sh -c "exec -a xxx python -c 'import sys, os; print re

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-10 Thread Ronald Oussoren
Ronald Oussoren added the comment: This doesn't fail on OSX when using a framework build of Python because that uses a different way to find sys.prefix: in Python.framework the shared library with the interpreter (libpython.so on Linux) is always in a known location relative to sys.prefix. -

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-10 Thread Florent Xicluna
Florent Xicluna added the comment: Actually there's 3 steps to fix this: 1) do not absolutize the sys.executable if it is empty (in Modules/getpath.c) 2) change sysconfig.py to deal with empty sys.executable (see this patch) 3) do a best effort to provide a valid sys.executable. It should be

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-10 Thread STINNER Victor
STINNER Victor added the comment: Twisted uses the following code (on UNIX-like OS): def launchWithName(name): if name and name != sys.argv[0]: exe = os.path.realpath(sys.executable) log.msg('Changing process name to ' + name) os.execv(exe, [name, sys.argv[0], '--ori

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-10 Thread STINNER Victor
STINNER Victor added the comment: Oooh, I shouldn't post messages at 3:05. "If sys.executable *is invalid*, sysconfig fails, site import fails, and finally Python *exits* (since my fix for #3137)." "It looks like there is *no* trivial, portable and/or reliable solution *to fix* this problem.

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-10 Thread STINNER Victor
STINNER Victor added the comment: This issue is not related to subprocess, subprocess is just used in examples to show the bug. The problem is that Python defines an invalid sys.executable if the process was created with a custom argv[0]. In Python trunk, the site module now uses sysconfig wh

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-10 Thread Florent Xicluna
Florent Xicluna added the comment: Fixed test failures related to incorrect sys.executable, which were visible after #3137 was fixed. Changesets r78830 and r78831. Note: there's 2 comments related to #7774. To review when this issue is fixed: - Lib/sysconfig.py - Lib/test/test_subprocess.py

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-10 Thread STINNER Victor
STINNER Victor added the comment: "Thanks to" my commit r78826 (fixing #3137), site errors are now fatal: Python exits with an error instead of just printing "import site failed; ...". It's the come back of #7774: test_executable_with_cwd of test_subprocess now always fail. The test fails be

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-03-05 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-02-11 Thread Florent Xicluna
Florent Xicluna added the comment: Similar failures with or without argv 0: ~ $ sh -c 'exec -a missing ./python -c "import sys; print sys.executable"' /home/user/dev/python/trunk/ ~ $ sh -c 'exec -a "" ./python -c "import sys; print sys.executable"' Could not find platform independent librar

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-02-09 Thread Florent Xicluna
Changes by Florent Xicluna : -- components: +Interpreter Core -Library (Lib) stage: test needed -> needs patch ___ Python tracker ___ _

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-01-25 Thread Ralf Schmitt
Ralf Schmitt added the comment: readlink("/proc/self/exe") would work on linux. (there's a similar link on freebsd). -- nosy: +schmir ___ Python tracker ___

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-01-25 Thread Florent Xicluna
Florent Xicluna added the comment: It may help to find other methods: http://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe By the way, it should not "absolutize" the path when sys.executable is irrelevant. IMHO, it should render an empty thing in s

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-01-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: How would you suggest to implement sys.executable if not by looking at sys.argv[0] (or the C equivalent, rather)? -- nosy: +pitrou ___ Python tracker _

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-01-25 Thread Tarek Ziadé
Tarek Ziadé added the comment: Ooops sorry Jesse, my brain has a hard link to your name when I see the word "process" ;) It comes out this bug is more related to 'sys' anyways. -- ___ Python tracker _

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-01-24 Thread Jesse Noller
Jesse Noller added the comment: I'm not the subprocess owner Tarek :( -- assignee: jnoller -> ___ Python tracker ___ ___ Python-bugs-

[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2010-01-24 Thread Florent Xicluna
Changes by Florent Xicluna : -- title: subprocess executable option wrong location -> sys.executable: wrong location if zeroth command argument is modified. ___ Python tracker __