[issue3723] Py_NewInterpreter does not work

Christian Heimes report at bugs.python.org
Sun Oct 26 23:58:42 CET 2008


Christian Heimes <lists at cheimes.de> added the comment:

The patch "subinterpreter.patch" is based on Martin's patch
"importexc.diff". The patch contains additional code to setup a
preliminary stderr object and a call to initstdio(). Amaury is right. I
had to add initstdio() to initialize the standard streams. But I can't
get it to work.

$ rm -f Demo/embed/importexc.o; cd Demo/embed; make; ./importexc; cd ../..
gcc -g -I../../Include -I../..  -c -o importexc.o importexc.c
gcc -Xlinker -export-dynamic importexc.o ../../libpython3.0.a  -lnsl
-ldl -lreadline -ltermcap -lieee -lpthread -lutil -lm -o importexc
Initialize interpreter
<module 'types' from '/usr/local/lib/python3.0/types.py'>

Initialize subinterpreter
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
  File "/usr/local/lib/python3.0/encodings/__init__.py", line 32, in
<module>
ValueError: Cannot encode path item
Aborted

Added file: http://bugs.python.org/file11895/subinterpreter.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3723>
_______________________________________


More information about the Python-bugs-list mailing list