[Python-3000] Unicode and OS strings (original) (raw)

Jean-Paul Calderone exarkun at divmod.com
Fri Sep 21 16:46:47 CEST 2007


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).

Jean-Paul



More information about the Python-3000 mailing list