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

John Nagle nagle at animats.com
Tue Jan 15 07:44:04 CET 2008

Benjamin wrote:
> On Jan 14, 6:26 pm, Bjoern Schliessmann <usenet-
> mail-0306.20.chr0n... at spamgourmet.com> wrote:
>> John Nagle wrote:
>>> It turns out that the strings in the "env" parameter have to be
>>> ASCII, not Unicode, even though Windows fully supports Unicode in
>>> CreateProcess.
>> Are you sure it supports Unicode, not UTF8 or UTF16? Probably using
>> something like u"thestring".encode("utf16") will help.
> Otherwise: bugs.python.org

     Whatever translation is necessary should be done in "popen", which
has cases for Windows and POSIX.  "popen" is supposed to be cross-platform
to the extent possible.  I think it's just something that didn't get fixed
when Unicode support went in.

					John Nagle

More information about the Python-list mailing list