This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author beda
Recipients beda
Date 2009-02-17.08:25:42
SpamBayes Score 6.378697e-07
Marked as misclassified No
Message-id <1234859144.87.0.49854960463.issue5290@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-02-17 08:25:44bedasetrecipients: + beda
2009-02-17 08:25:44bedasetmessageid: <1234859144.87.0.49854960463.issue5290@psf.upfronthosting.co.za>
2009-02-17 08:25:43bedalinkissue5290 messages
2009-02-17 08:25:42bedacreate