Author vstinner
Recipients amaury.forgeotdarc, benjamin.peterson, christian.heimes, eric.araujo, grahamd, loewis, ncoghlan, pitrou, python-dev, tarek, vstinner
Date 2011-04-25.23:27:33
SpamBayes Score 5.55112e-17
Marked as misclassified No
Message-id <1303774056.54.0.539241963569.issue10914@psf.upfronthosting.co.za>
In-reply-to
Content
> The problem is the test on the "python initialization":
> PyUnicode_EncodeFSDefault / PyUnicode_DecodeFSDefaultAndSize
> check the global Py_FileSystemDefaultEncoding variable (use
> C functions if it is NULL).

The problem is a little bit more complex. interp->codecs_initialized is set to 1 by _PyCodecRegistry_Init(), but the filesystem codec is not loaded yet. We need another variable: interp->fscodec_initialized.

fscodec_subinterpreter.patch fixes this issue.

Note: the patch replaces also PyErr_Print() by PyErr_PrintEx(0) to avoid a crash on error, if PyErr_PrintEx(0) is called before the sys module is initialized. For example, if PyModule_GetDict(_PyImport_FindBuiltin("builtins")) is NULL. Anyway, it's useless to set sys attributes on error, because sys is destroyed just after printing the error.
History
Date User Action Args
2011-04-25 23:27:37vstinnersetrecipients: + vstinner, loewis, amaury.forgeotdarc, ncoghlan, pitrou, christian.heimes, benjamin.peterson, tarek, eric.araujo, grahamd, python-dev
2011-04-25 23:27:36vstinnersetmessageid: <1303774056.54.0.539241963569.issue10914@psf.upfronthosting.co.za>
2011-04-25 23:27:34vstinnerlinkissue10914 messages
2011-04-25 23:27:34vstinnercreate