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

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

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 = L"python3";

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(L"python3");
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

Reply via email to