New submission from Palm Kevin <[email protected]>:
The new API method Py_SetPath seems bugged. When executing the following code,
then the application crashes on Py_Initialize()-call:
#include "Python.h"
main(int argc, char **argv)
{
Py_SetPath(Py_GetPath());
printf("Init\n");
Py_Initialize();
printf("-- END\n");
}
The raised exception is the following:
Traceback (most recent call last):
File "/usr/labsolution/python32/lib/python3.2/sysconfig.py", line 332, in
_init_posix
_parse_makefile(makefile, vars)
File "/usr/labsolution/python32/lib/python3.2/sysconfig.py", line 220, in
_parse_makefile
with open(filename, errors="surrogateescape") as f:
IOError: [Errno 2] No such file or directory:
'lib/python3.2/config-3.2m/Makefile'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/labsolution/python32/lib/python3.2/site.py", line 529, in <module>
main()
File "/usr/labsolution/python32/lib/python3.2/site.py", line 517, in main
known_paths = addusersitepackages(known_paths)
File "/usr/labsolution/python32/lib/python3.2/site.py", line 263, in
addusersitepackages
user_site = getusersitepackages()
File "/usr/labsolution/python32/lib/python3.2/site.py", line 238, in
getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/labsolution/python32/lib/python3.2/site.py", line 228, in
getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/labsolution/python32/lib/python3.2/sysconfig.py", line 590, in
get_config_var
return get_config_vars().get(name)
File "/usr/labsolution/python32/lib/python3.2/sysconfig.py", line 487, in
get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/labsolution/python32/lib/python3.2/sysconfig.py", line 337, in
_init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open
lib/python3.2/config-3.2m/Makefile (No such file or directory)
(perhaps linked to issue #10743 ?!)
----------
components: Interpreter Core
messages: 129372
nosy: palm.kevin
priority: normal
severity: normal
status: open
title: Usage of API method Py_SetPath causes errors in Py_Initialize() (Posix
ony))
type: crash
versions: Python 3.2
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11320>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com