"env" parameter to "popen" won't accept Unicode on Windows -minor Unicode bug

Brian Smith brian at briansmith.org
Tue Jan 15 07:42:46 EST 2008


Diez B. Roggisch wrote:
> Sure thing, python will just magically convert unicode to the 
> encoding the program YOU invoke will expect. Right after we 
> introduced the
> 
> solve_my_problem()
> 
> built-in-function. Any other wishes?

There's no reason to be rude.

Anyway, at least on Windows it makes perfect sense for people to expect
Unicode to be handled automatically. popen() knows that it is running on
Windows, and it knows what encoding Windows needs for its environment
(it's either UCS2 or UTF-16 for most Windows APIs). At least when it
receives a unicode string, it has enough information to apply the
conversion automatically, and doing so saves the caller from having to
figure out what exact encoding is to be used.

- Brian




More information about the Python-list mailing list