[New-bugs-announce] [issue11169] compileall doesn't support the PEP 383 (undecodable paths/filenames)

STINNER Victor report at bugs.python.org
Thu Feb 10 13:38:46 CET 2011

New submission from STINNER Victor <victor.stinner at haypocalc.com>:

The compileall uses print("bla", filename, "bla") to write messages to the console. But the print fails if the filename cannot be encoded to the console encoding. It occurs if the filename is an undecodable filename encoded by the PEP 383 using surrogates. For example, UTF-8 cannot encode surrogates.

Attached patch uses repr() to escape surrogates: it adds also quotes to the filename. I don't know if it is a problem to add quotes. I prefer quotes, but it is more readable if the path or the filename contain spaces.

components: Unicode
files: compileall_surrogates.patch
keywords: patch
messages: 128288
nosy: haypo
priority: normal
severity: normal
status: open
title: compileall doesn't support the PEP 383 (undecodable paths/filenames)
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file20729/compileall_surrogates.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list