[issue15020] Poor default value for progname in pythonrun.c

2012-06-08 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +eric.araujo
title: Poor default value for progname - Poor default value for progname in 
pythonrun.c

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15020
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15020] Poor default value for progname

2012-06-07 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +loewis
versions: +Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15020
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15020] Poor default value for progname

2012-06-06 Thread Joshua Cogliati

New submission from Joshua Cogliati jrinc...@gmail.com:

In Python/pythonrun.c the following definition exists:
static wchar_t *progname = Lpython;

This is then used by Py_GetProgramName which is used by calculate_path in 
Modules/getpath.c 

Since in python 3, the default executable is python3, and not python, when 
calculate_path searches for python it will find where python 2 is installed 
instead of where python3 is installed.  This is the error message that this 
causes:

Could not find platform independent libraries prefix
Could not find platform dependent libraries exec_prefix
Consider setting $PYTHONHOME to prefix[:exec_prefix]

I recommend that line be changed to:
static wchar_t *progname = Lpython3;

since that is the default executable name.

For my purposes (which is making an executable that embedds python 3), I was 
able to work around this by calling: 
Py_SetProgramName(Lpython3);
before
Py_Initialize();

--
messages: 162425
nosy: Joshua.Cogliati
priority: normal
severity: normal
status: open
title: Poor default value for progname
type: behavior
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15020
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15020] Poor default value for progname

2012-06-06 Thread Joshua Cogliati

Joshua Cogliati jrinc...@gmail.com added the comment:

Here is a part of an strace where Python fails to find python3:
(This would work if progname=Lpython3 )
...
23249 stat(/opt/python/3.2.2.3/bin/python, 0x7fff2881cbf0) = -1 ENOENT 
(No such file or directory)
23249 readlink(/usr/local/bin/python, /usr/bin/python, 4096) = 15
23249 readlink(/usr/bin/python, python2.7, 4096) = 9
23249 readlink(/usr/bin/python2.7, 0x7fff2881bb70, 4096) = -1 EINVAL (Invalid 
argument)
23249 stat(/usr/bin/Modules/Setup, 0x7fff2881cbf0) = -1 ENOENT (No such file 
or directory)
23249 stat(/usr/bin/lib/python3.2/os.py, 0x7fff2881cbf0) = -1 ENOENT (No such 
file or directory)
23249 stat(/usr/bin/lib/python3.2/os.pyc, 0x7fff2881cbf0) = -1 ENOENT (No 
such file or directory)
23249 stat(/usr/lib/python3.2/os.py, 0x7fff2881cbf0) = -1 ENOENT (No such 
file or directory)
23249 stat(/usr/lib/python3.2/os.pyc, 0x7fff2881cbf0) = -1 ENOENT (No such 
file or directory)
23249 stat(/lib/python3.2/os.py, 0x7fff2881cbf0) = -1 ENOENT (No such file or 
directory)
23249 stat(/lib/python3.2/os.pyc, 0x7fff2881cbf0) = -1 ENOENT (No such file 
or directory)
23249 write(2, Could not find platform independ..., 55) = 55
...
$ which python3
/opt/python/3.2.2.3/bin/python3

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15020
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com