Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#22322 - [python2] sys.executable defaults to /usr/bin/python in nautilus extensions

Attached to Project: Arch Linux
Opened by ilya (leniviy) - Wednesday, 05 January 2011, 11:14 GMT
Last edited by Stéphane Gaudreault (stephane) - Thursday, 06 January 2011, 12:20 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Allan McRae (Allan)
Stéphane Gaudreault (stephane)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
In Python the variable 'sys.executable' is usually set to argv[0]. If argv[0] is empty string, it's set to some hardcoded value, which is /usr/bin/python .
In python-nautilus (and probably other embedded Python 2 stuff) sys.executable defaults to /usr/bin/python, a symlink to python3. Affected:
http://aur.archlinux.org/packages.php?ID=34482
http://aur.archlinux.org/packages.php?ID=22823

Additional info:
* package version(s)
python2 2.7.1-3

Steps to reproduce:
$ sh -c "exec -a '' python2 -c 'import sys; print sys.executable'"
/usr/bin/python

Proposed fix: in pythonrun.c change "python" to "python2" here:
static char *progname = "python";
This task depends upon

Closed by  Stéphane Gaudreault (stephane)
Thursday, 06 January 2011, 12:20 GMT
Reason for closing:  Fixed
Additional comments about closing:  Workaround implemented in python2-2.7.1-4. I am looking forward to an upstream fix.
Comment by Allan McRae (Allan) - Wednesday, 05 January 2011, 12:11 GMT
@Stephane: probably should change it to "python2.7".

I'm filing an upstream bug report.
Comment by Allan McRae (Allan) - Wednesday, 05 January 2011, 12:52 GMT Comment by ilya (leniviy) - Wednesday, 05 January 2011, 12:53 GMT Comment by Allan McRae (Allan) - Wednesday, 05 January 2011, 12:58 GMT
Yeah - that is a more specific issue that this one. This fix proposed for this bug does not require platform specific code so it hopefully will be acceptable.
Comment by Stéphane Gaudreault (stephane) - Wednesday, 05 January 2011, 16:16 GMT
The fix for upstream bug #7774 is already implemented in 2.7.1 (see Misc/NEWS file in the source tarball).

Loading...