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

2008-01-15 Thread Bjoern Schliessmann
John Nagle wrote: > The problem is that only the NT-derived Microsoft systems > talk Unicode. The DOS/Win16/Win9x family did not. But they did > have CreateProcess. So the current code will handle Win9x, but not > Unicode. Please explain, I don't understand. If you try using Windows system functio

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

2008-01-15 Thread John Nagle
Diez B. Roggisch wrote: > Brian Smith wrote: > >> 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? >>

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

2008-01-15 Thread John Nagle
Diez B. Roggisch wrote: > John Nagle wrote: > >> Benjamin wrote: >>> On Jan 14, 6:26 pm, Bjoern Schliessmann >> [EMAIL PROTECTED]> 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 Unicod

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

2008-01-15 Thread Bjoern Schliessmann
Brian Smith wrote: > 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

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

2008-01-15 Thread Diez B. Roggisch
Brian Smith wrote: > 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. I

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

2008-01-15 Thread Brian Smith
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 m

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

2008-01-15 Thread Diez B. Roggisch
John Nagle wrote: > Benjamin wrote: >> On Jan 14, 6:26 pm, Bjoern Schliessmann > [EMAIL PROTECTED]> 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. That's o

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

2008-01-14 Thread John Nagle
Benjamin wrote: > On Jan 14, 6:26 pm, Bjoern Schliessmann [EMAIL PROTECTED]> 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,

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

2008-01-14 Thread Benjamin
On Jan 14, 6:26 pm, John Nagle <[EMAIL PROTECTED]> 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 s

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

2008-01-14 Thread Benjamin
On Jan 14, 6:26 pm, Bjoern Schliessmann 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 >

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

2008-01-14 Thread Bjoern Schliessmann
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. Rega

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

2008-01-14 Thread John Nagle
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 b