Python 3 encoding question: Read a filename from stdin, subsequently open that filename

Peter Otten __peter__ at web.de
Thu Dec 2 06:17:53 EST 2010


Nobody wrote:

> This was actually a critical flaw in Python 3.0, as it meant that
> filenames which weren't valid in the locale's encoding simply couldn't be
> passed via argv or environ. 3.1 fixed this using the "surrogateescape"
> encoding, so now it's only an annoyance (i.e. you can recover the original
> bytes once you've spent enough time digging through the documentation).

Is it just that you need to harden your scripts against these byte sequences 
or do you actually encounter them? If the latter, can you give some 
examples?



More information about the Python-list mailing list