Message134425
> 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. |
|
Date |
User |
Action |
Args |
2011-04-25 23:27:37 | vstinner | set | recipients:
+ vstinner, loewis, amaury.forgeotdarc, ncoghlan, pitrou, christian.heimes, benjamin.peterson, tarek, eric.araujo, grahamd, python-dev |
2011-04-25 23:27:36 | vstinner | set | messageid: <1303774056.54.0.539241963569.issue10914@psf.upfronthosting.co.za> |
2011-04-25 23:27:34 | vstinner | link | issue10914 messages |
2011-04-25 23:27:34 | vstinner | create | |
|