New submission from STINNER Victor <victor.stin...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue11169>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to