Message82304
The method subprocess.Popen.communicate (more the underlying
_communicate) writes the input to the stdin stream without encoding,
regardless of it being a unicode string. The result is incorrect
behavior of the running program as it receives 4 bytes for each character.
As simple text program is here:
import subprocess
from base64 import b16encode
command = ["cat"]
p = subprocess.Popen(command, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
data = u"test text"
o, er = p.communicate(data)
print b16encode(o)
I believe that this issue is closely related to Issue2683 where this was
fixed for Python 3.0. |
|
Date |
User |
Action |
Args |
2009-02-17 08:25:44 | beda | set | recipients:
+ beda |
2009-02-17 08:25:44 | beda | set | messageid: <1234859144.87.0.49854960463.issue5290@psf.upfronthosting.co.za> |
2009-02-17 08:25:43 | beda | link | issue5290 messages |
2009-02-17 08:25:42 | beda | create | |
|