Author ncoghlan
Recipients Arfrever, Brecht.Van.Lommel, asvetlov, christian.heimes, ideasman42, lemburg, loewis, ncoghlan, vstinner
Date 2013-09-16.14:48:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1379342906.15.0.844169909346.issue16129@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2013-09-16 14:48:26ncoghlansetrecipients: + ncoghlan, lemburg, loewis, vstinner, christian.heimes, Arfrever, asvetlov, ideasman42, Brecht.Van.Lommel
2013-09-16 14:48:26ncoghlansetmessageid: <1379342906.15.0.844169909346.issue16129@psf.upfronthosting.co.za>
2013-09-16 14:48:26ncoghlanlinkissue16129 messages
2013-09-16 14:48:25ncoghlancreate