Steve Dower added the comment:

Seems like a fairly obvious bug. From 
https://docs.python.org/3/c-api/init.html#c.Py_SetPath

> This also causes ... sys.prefix and sys.exec_prefix to be empty.
> It is up to the caller to modify these if required after calling
> Py_Initialize().

Apparently you can't set `sys.[exec_]prefix` before calling Py_Initialize, and 
you can't call Py_Initialize without setting `sys.[exec_]prefix` (much like 
#20891, where you can't initialize threads without holding the GIL, and you 
can't acquire the GIL without having initialized threads.)

I don't know how to go about resolving this though (my changes were limited to 
getpathp.c - and I really need to go add the same changes to the non-Windows 
getpath.c too...). The best way seems to be forcing Nick to finish PEP 432, but 
unfortunately I have no leverage over him :)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11320>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to