[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

This should be fixed now. Thanks!

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-05 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset c97d78415f5a by Antoine Pitrou in branch '3.2':
Issue #15020: The program name used to search for Python's path is now 
"python3" under Unix, not "python".
http://hg.python.org/cpython/rev/c97d78415f5a

New changeset 61e6ac40c816 by Antoine Pitrou in branch 'default':
Issue #15020: The program name used to search for Python's path is now python3 
under Unix, not python.
http://hg.python.org/cpython/rev/61e6ac40c816

--
nosy: +python-dev

___
Python tracker 

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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Okay, that's convincing enough. Besides, I don't think it has ever worked for 
Windows, since it misses the adding of a ".exe" suffix.

--

___
Python tracker 

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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-05 Thread Joshua Cogliati

Joshua Cogliati  added the comment:

> Joshua, if you are embedding Python, why don't you simply call Py_SetPath to 
> set the search path appropriately? Or is it not enough? (I've lost memory of 
> the mazy details of how we calculate paths :-S).

Setting Py_SetPath manually would basically require me to replicate the work 
done in Modules/getpath.c to figure out where the python libraries are.  I 
already set PYTHONPATH to get it to find my own modules.  (Note that there is a 
big difference between setting PYTHONPATH the environmental variable and 
calling Py_SetPath, Py_SetPath assumes that you are setting the python library 
module paths as well.)

The basic problem is that in function calculate_path (inside of 
Modules/getpath.c ) it has the following code:

char *_path = getenv("PATH");
...
wchar_t *prog = Py_GetProgramName();
...
 while (1) {
...
joinpath(progpath, prog);
if (isxfile(progpath))
break;
...

which goes through the path and tries to find an executable with the same name 
as returned by Py_GetProgramName()

So if I do a """Py_SetProgramName(L"python3");""" that method works because 
prog="python3" but if I don't then the method fails because prog="python".  

Basically, to fix this bug, somehow, "wchar_t *prog =" in calculate_path needs 
to get the actual python executable for this version of python.

--

___
Python tracker 

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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Hmm, actually, there is a potential problem. While "python3" is the official 
binary under POSIX, under Windows it is "python" (well, "python.exe").

Joshua, if you are embedding Python, why don't you simply call Py_SetPath to 
set the search path appropriately? Or is it not enough? (I've lost memory of 
the mazy details of how we calculate paths :-S).

--

___
Python tracker 

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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-05 Thread Joshua Cogliati

Joshua Cogliati  added the comment:

> Joshua: what command did you run under strace?

A program I created that embeds python3.  I could create a minimum piece of 
code that triggered the bug if needed.

> Maybe it would be better to use L"python3.2" for Python 3.2 and L"python3.3" 
> for Python 3.3.

L"python3.2" and L"python3.3" would work better than the current L"python" 
since calculate_path assumes that progname is the name of an actual executable 
for python 3.  It only sorta works now with L"python" if python 2 and python 3 
are installed in the same location, which was not the case for me since python 
2 came with the system and python 3 was a local install.

--

___
Python tracker 

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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-04 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

Maybe it would be better to use L"python3.2" for Python 3.2 and L"python3.3" 
for Python 3.3.

--
nosy: +Arfrever

___
Python tracker 

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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

This sounds reasonable. Is there any reason that this change might be 
detrimental?

--
nosy: +pitrou

___
Python tracker 

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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-02 Thread Éric Araujo

Éric Araujo  added the comment:

Joshua: what command did you run under strace?

--

___
Python tracker 

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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-02 Thread Éric Araujo

Éric Araujo  added the comment:

Any opposition?

--
nosy: +benjamin.peterson, georg.brandl

___
Python tracker 

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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-06-13 Thread Joshua Cogliati

Changes by Joshua Cogliati :


--
title: Poor default value for progname in pythonrun.c -> default value for 
progname in pythonrun.c should be python3 for Python 3

___
Python tracker 

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