[Python-3000] Unicode and OS strings

Thomas Heller theller at ctypes.org
Fri Sep 21 17:18:01 CEST 2007


Jean-Paul Calderone schrieb:
> On Fri, 21 Sep 2007 10:00:38 -0400, Jim Jewett <jimjjewett at gmail.com> wrote:
>> [snip]
>>
>>It does sound like we need a way to get to the original bytes, similar
>>to sys.stdin.buffer.  Is it reasonable to expose sys.argv.buffer?
>>(Since this would be bytes rather than text, I assume this would be a
>>single array, rather than a list of already separated arguments.)
> 
> Without commenting on whether this is a good idea overall or not, it
> would not be a single array, rather than a list of already separated
> arguments, because it is given to the C main() function as an array
> of char*, not a single char*.
> 
> On Windows it's more complicated, but the same argument can probably
> be applied (or it should also reflect the underlying system API on
> Windows, which means on Windows it will be a single bytes object
> instead of a list of them, but only on Windows. This goes beyond
> even the 2.x level of low-level detail exposure).

I *hope* that on Windows, these objects will be unicode not bytes
objects - the wide windows api should be used to get these values.
No conversion needed.

Thomas



More information about the Python-3000 mailing list