[Twisted-Python] Python 3: bytes vs. str in twisted.python.filepath

Tristan Seligmann mithrandi at mithrandi.net
Sun Jul 14 04:27:47 MDT 2013


On Sun, Jul 14, 2013 at 4:00 AM, Harry Bock <bock.harryw at gmail.com> wrote:

> (b) Misunderstandings at the application level about the underlying
> filesystem's path encoding is not the problem of the Twisted API.  Correct
> me if I'm wrong, but that's the responsibility of the system administrator
> or individual user (at least on UNIX) to set the LANG environment variable,
> or for the application to call setlocale(3) to explicitly override it.
>

There is no way to enforce a particular setting of the LANG environment
variable globally; multiple users could use filenames encoded in different
encodings (in fact even a single user could do this), and files could be
transferred from other systems using different encodings. While a
reasonable person might insist on the use of UTF-8 everywhere, there is no
way to guarantee that UNIX filenames are all in the same encoding, or are
even in any particular encoding at all (they might be binary non-text
garbage), and the inability to deal with filenames like this would be
somewhat of a serious defect.

On Windows, the reverse situation obtains, of course.
-- 
mithrandi, i Ainil en-Balandor, a faer Ambar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20130714/47d13d66/attachment-0002.html>


More information about the Twisted-Python mailing list