[New-bugs-announce] [issue2798] Crash on non-Windows if Python runs from a non-ASCII directory

Antoine Pitrou report at bugs.python.org
Fri May 9 12:05:00 CEST 2008

New submission from Antoine Pitrou <pitrou at free.fr>:

(Note: I'm splitting this from #1342 because the fix is much simpler in
the non-Windows case)

py3k does not accept running from a path with non-ascii characters.

$ pwd
$ ./python
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
  File "/home/antoine/py3k/pristine/Lib/encodings/__init__.py", line 32,
in <module>
TypeError: zipimporter() argument 1 must be string without null bytes,
not str

The following patch solves the problem by fixing a bug in getargs.c
where the "no null bytes" check for non-ASCII strings was wrong.

There is still a failing test, test_xmlrpc, apparently because xmlrpc
wants to output its path in an HTTP header using the "ascii" encoding...
I'd say this is an xmlrpc issue and not an issue with the patch.

components: Interpreter Core
files: getargs.patch
keywords: patch
messages: 66461
nosy: christian.heimes, pitrou
severity: normal
status: open
title: Crash on non-Windows if Python runs from a non-ASCII directory
type: crash
versions: Python 3.0
Added file: http://bugs.python.org/file10230/getargs.patch

Tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list