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 kermode
Recipients kermode
Date 2008-04-24.18:57:19
SpamBayes Score 0.020457722
Marked as misclassified No
Message-id <1209063440.61.0.967116488341.issue2683@psf.upfronthosting.co.za>
In-reply-to
Content
subprocess.Popen.communicate is documented as taking a string as the 
input argument. Instead is accepts only a binary stream (bytes).

Python 3.0a4 (r30a4:62126, Apr  3 2008, 15:34:18) [MSC v.1500 32 bit 
(Intel)] on
 win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from subprocess import Popen, PIPE
>>> p = Popen('command.com', stdin=PIPE)
>>> p.communicate("dir\n")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python30\lib\subprocess.py", line 588, in communicate
    self.stdin.write(input)
  File "C:\Python30\lib\io.py", line 844, in write
    raise TypeError("can't write str to binary stream")
TypeError: can't write str to binary stream
History
Date User Action Args
2008-04-24 18:57:20kermodesetspambayes_score: 0.0204577 -> 0.020457722
recipients: + kermode
2008-04-24 18:57:20kermodesetspambayes_score: 0.0204577 -> 0.0204577
messageid: <1209063440.61.0.967116488341.issue2683@psf.upfronthosting.co.za>
2008-04-24 18:57:19kermodelinkissue2683 messages
2008-04-24 18:57:19kermodecreate