[Distutils] Wheels and console script entry point wrappers (Was: Replacing pip.exe with a Python script)

Vinay Sajip vinay_sajip at yahoo.co.uk
Fri Jul 19 18:13:43 CEST 2013

Oscar Benjamin <oscar.j.benjamin <at> gmail.com> writes:

> Python 2.x uses GetCommandLineA and 3.x uses GetCommandLineW. A
> wrapper to launch 2.x should use GetCommandLineA and CreateProcessA to
> ensure that the 8-bit argument strings are passed through unaltered.
> To launch 3.x it should use the W versions. If not then the MSVC
> runtime (or the OS?) will convert between the 8-bit and 16-bit
> encodings using its own lossy routines.

There is a standalone launcher available (referenced in PEP 397) which was the 
reference implementation, but it uses Unicode throughout. I would have assumed 
that whatever provided the decoding behind GetCommandLineW would use the same 
encoding in CreateProcessW(..., unicode_command_line, ...). Do you have any 
specific examples showing potential failure modes? 


Vinay Sajip

More information about the Distutils-SIG mailing list