[issue6501] Fatal LookupError: unknown encoding: cp0 on Windows embedded startup.

2009-12-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, this might prevent the crash but how does the system behave afterwards? Do the standard streams use utf-8 by default? At the minimum, we should still output a warning on stderr. -- ___ Python tracker

[issue6501] Fatal LookupError: unknown encoding: cp0 on Windows embedded startup.

2009-12-20 Thread Florent Xicluna
Florent Xicluna added the comment: Patch to prevent crash when PYTHONIOENCODING is invalid: ~ $ PYTHONIOENCODING= ./python Fatal Python error: Py_Initialize: can't initialize sys standard streams LookupError: unknown encoding: Abandon -- keywords: +patch nosy: +flox versions: +Python

[issue6501] Fatal LookupError: unknown encoding: cp0 on Windows embedded startup.

2009-08-05 Thread Graham Dumpleton
Graham Dumpleton added the comment: Python should be as robust as possible and thus should be fixed, but I am happy with using the workaround so if this is more a question of what priority to mark this, I wouldn't see it as being urgent. -- ___ Pyt

[issue6501] Fatal LookupError: unknown encoding: cp0 on Windows embedded startup.

2009-08-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Graham, is the workaround ok for you or do you think this is something Python itself should handle? -- nosy: +pitrou ___ Python tracker ___

[issue6501] Fatal LookupError: unknown encoding: cp0 on Windows embedded startup.

2009-07-22 Thread Graham Dumpleton
Graham Dumpleton added the comment: The workaround of using: #if defined(WIN32) && PY_MAJOR_VERSION >= 3 _wputenv(L"PYTHONIOENCODING=cp1252:backslashreplace"); #endif Py_Initialize(); gets around the crash on startup. I haven't done sufficient testing to know if this may intr

[issue6501] Fatal LookupError: unknown encoding: cp0 on Windows embedded startup.

2009-07-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: On a Western Windows, I suggest PYTHONIOENCODING=cp1252:backslashreplace But PYTHONIOENCODING=mbcs is also OK, except that characters outside the Windows code page will be replaced with '?' -- ___ Py

[issue6501] Fatal LookupError: unknown encoding: cp0 on Windows embedded startup.

2009-07-17 Thread Graham Dumpleton
Graham Dumpleton added the comment: Yes, Apache remaps stdout and stderr to the Apache error log to still capture anything that errant modules don't log via the Apache error log functions. In mod_wsgi it replaces sys.stdout and sys.stderr with special file like objects that redirect via Apach

[issue6501] Fatal LookupError: unknown encoding: cp0 on Windows embedded startup.

2009-07-17 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: - Apache is not a Console application, so the Windows GetConsoleCP() function returns zero (and os.device_encoding(1) returns 'cp0'). - pythonw.exe has no console either; but in pythonrun.c, the test (fileno(stdin) < 0) is true, and the standard streams ar

[issue6501] Fatal LookupError: unknown encoding: cp0 on Windows embedded startup.

2009-07-17 Thread Graham Dumpleton
New submission from Graham Dumpleton : When using Python 3.1 for Apache/mod_wsgi (3.0c4) on Windows, Apache will crash on startup because Python is forcing the process to exit with: Fatal Python error: Py_Initialize: can't initialize sys standard streams LookupError: unknown encoding: cp0 I fi