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

Benjamin musiccomposition at gmail.com
Mon Jan 14 22:26:35 EST 2008


On Jan 14, 6:26 pm, John Nagle <na... at animats.com> wrote:
> I passed a dict for the "env" variable to Popen with Unicode strings
> for the dictionary values.
>
> Got:
>
>    File "D:\Python24\lib\subprocess.py", line 706, in _execute_child
>                 TypeError: environment can only contain strings
>
> It turns out that the strings in the "env" parameter have to be ASCII,
> not Unicode, even though Windows fully supports Unicode in CreateProcess.

>
>                                 John Nagle




More information about the Python-list mailing list