STINNER Victor <victor.stin...@haypocalc.com> added the comment: Patch for the second solution (fallback to utf-8 on get_codeset() failure):
- create a subfunction initfsencoding() (Py_InitializeEx is already very long) - hardcode the encoding to utf-8 if nl_langinfo(CODESET) is missing - don't call get_codeset() on Windows or Mac OS X - call _PyCodec_Lookup(Py_FileSystemDefaultEncoding) if get_codeset() was not called (eg. on Windows) or if get_codeset() failed to ensure that the codec can be (and is) loaded: display a fatal error on failure Since I wrote patches for both solution, I can now compare correctly advantages and disavantages. I prefer initfsencoding() because it works on all cases and is simpler than no_fsencoding_error.patch. ---------- Added file: http://bugs.python.org/file17214/initfsencoding.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8610> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com