[Python-Dev] Support byte string API of Windows in Python3? (original) (raw)

Neil Hodgson nyamatongwe at gmail.com
Tue Apr 20 00:39:07 CEST 2010


Victor Stinner:

It's a choice, I didn't want to patch Windows because I know that Windows use unicode internally. I consider that developers using Python3 should use unicode on Windows, and byte or unicode+surrogates on other OS.

The Win32 byte string APIs convert their inputs to Unicode and then run Unicode code. You don't get additional capabilities by calling the byte string APIs and should avoid them completely.

Including an easy way to invoke them on Windows will just lead to failures. People may think that Unix code that uses the byte string APIs for better platform fidelity can just run this code on Windows and get equivalent benefits. They won't and instead will see an inverted form of the problems they are trying to avoid on Unix.

If there is ever a reason to use a byte string API on Windows (and I can't think of any) then ctypes can be used to explicitly call the API desired.

Neil



More information about the Python-Dev mailing list