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

"Martin v. Löwis" martin at v.loewis.de
Wed Dec 1 02:23:54 EST 2010


> It'd be great if all programs used the same encoding on a given OS,
> but at least on Linux, I believe historically filenames have been
> created with different encodings.  IOW, if I pick one encoding and go
> with it, filenames written in some other encoding are likely to cause
> problems.  So I need something for which a filename is just a blob
> that shouldn't be monkeyed with.

In that case, you should use byte strings as file names, not
character strings.

Regards,
Martin




More information about the Python-list mailing list