Message197903
The gory details of the current startup situation are in PEP 432. However, the comprehensive solution described in that PEP isn't going to make it into Python 3.4, so a simpler interim fix would be worthwhile.
Since Blender is designed to support building against the system Python, the trick of forcing Python to link to an alternate implementation of a function won't work.
Inspired by http://docs.python.org/3/c-api/init.html#Py_SetPath, I suggest offering an API like:
int Py_SetStandardStreamEncoding(char *encoding, char *errors)
{
if (Py_IsInitialized()) {
return -1;
}
Py_StandardStreamEncoding = _PyMem_Strdup(encoding);
Py_StandardStreamErrors = _PyMem_Strdup(errors);
}
The initstdio function in pythonrun.c would then be updated to use the specified Py_StandardStreamEncoding and Py_StandardStreamErrors if they weren't NULL (since that would indicate an embedding application had called SetStandardStreamEncoding). |
|
Date |
User |
Action |
Args |
2013-09-16 14:48:26 | ncoghlan | set | recipients:
+ ncoghlan, lemburg, loewis, vstinner, christian.heimes, Arfrever, asvetlov, ideasman42, Brecht.Van.Lommel |
2013-09-16 14:48:26 | ncoghlan | set | messageid: <1379342906.15.0.844169909346.issue16129@psf.upfronthosting.co.za> |
2013-09-16 14:48:26 | ncoghlan | link | issue16129 messages |
2013-09-16 14:48:25 | ncoghlan | create | |
|