mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
#2683: Popen.communicate() argument must be bytes.
This commit is contained in:
parent
c22ed14ddd
commit
1abcbf8e19
3 changed files with 5 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue