[Python-Dev] PEP 383 (again)

Thomas Breuel tmbdev at gmail.com
Tue Apr 28 21:24:40 CEST 2009

On Tue, Apr 28, 2009 at 20:45, "Martin v. Löwis" <martin at v.loewis.de> wrote:

> > Furthermore, I don't believe that PEP 383 works consistently on Windows,
> What makes you say that? PEP 383 will have no effect on Windows,
> compared to the status quo, whatsoever.

That's what you believe, but it's not clear to me that that follows from
your proposal.

Your proposal says that utf-8b would be used for file systems, but then you
also say that it might be used for command line arguments and environment
variables.  So, which specific APIs will it be used with on Windows and on
POSIX systems?   Or will utf-8b simply not be available on Windows at all?
What happens if I create a Python version of tar, utf-8b strings slip in
there, and I try to use them on Windows?

You also assume that all Windows file system functions strictly conform to
UTF-16 in practice (not just on paper).  Have you verified that?  It
certainly isn't true across all versions of Windows (since NT originally
used UCS-2).   What's the situation on Windows CE?

Another question on Linux: what happens when I decode a file system path
with utf-8b and then pass the resulting unicode string to Gnome?  To Qt?  To
windows.forms?  To Java?  To a unicode regular expression library?  To
wprintf?  AFAIK, the behavior of most libraries is undefined for the kinds
of unicode strings you construct, and it may be undefined in a bad way
(crash, buffer overflow, whatever).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20090428/e6c2200c/attachment.htm>

More information about the Python-Dev mailing list