[Python-Dev] Support byte string API of Windows in Python3?

Victor Stinner victor.stinner at haypocalc.com
Tue Apr 20 01:35:57 CEST 2010


Le lundi 19 avril 2010 22:55:39, vous avez écrit :
> Can you please elaborate what the specific issue is?

Amaury reopened my issue #8393 "subprocess: support undecodable current 
working directory on POSIX OS" because "It does not work on Windows" (bytes 
are rejected).

> I completely fail to see what byte strings have to do with surrogate 
> codes. AFAICT, on Windows, you can just use surrogate codes at the APIs,
> and be done.

Before my patch, subprocess used PyArg_ParseTuple(args, "...z...", ...) to 
parse the current working directory: surrogates were rejected. But I specified 
in my issue title that the issue is specific to "POSIX OS". I should replace 
it by "non-Windows".

--

Amaury also reopened #8394 "ctypes.dlopen() doesn't support surrogates", 
because ctypes.CDLL() rejects byte string.

On Windows, Python3 uses LoadLibraryW() to load a library, and the Python API 
rejects byte string.

--

The question was: should we change python3 to accept byte strings on Windows?

I think that I can re-close these two issues because it's a good thing to 
avoid the evil, locale dependent, mbcs encoding ;-) Unicode is a superset of 
mbcs.

-- 
Victor Stinner
http://www.haypocalc.com/


More information about the Python-Dev mailing list