#2683: Popen.communicate() argument must be bytes.

This commit is contained in:
Georg Brandl 2008-07-01 19:28:43 +00:00
parent c22ed14ddd
commit 1abcbf8e19
3 changed files with 5 additions and 8 deletions

View file

@ -883,8 +883,6 @@ class Popen(object):
if self.stdin:
if input is not None:
if isinstance(input, str):
input = input.encode()
self.stdin.write(input)
self.stdin.close()
@ -1129,10 +1127,6 @@ class Popen(object):
def _communicate(self, input):
if self.stdin:
if isinstance(input, str): # Unicode
input = input.encode("utf-8") # XXX What else?
input = bytes(input)
read_set = []
write_set = []
stdout = None # Return