mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Issue #16903: Popen.communicate() on Unix now accepts strings when
universal_newlines is true as on Windows.
This commit is contained in:
parent
0b4591e0eb
commit
b3f194d109
4 changed files with 40 additions and 5 deletions
|
|
@ -1519,6 +1519,8 @@ class Popen(object):
|
|||
fd2output[self.stderr.fileno()] = stderr = []
|
||||
|
||||
input_offset = 0
|
||||
if self.universal_newlines and isinstance(input, str):
|
||||
input = input.encode(self.stdin.encoding)
|
||||
while fd2file:
|
||||
try:
|
||||
ready = poller.poll()
|
||||
|
|
@ -1571,6 +1573,8 @@ class Popen(object):
|
|||
stderr = []
|
||||
|
||||
input_offset = 0
|
||||
if self.universal_newlines and isinstance(input, str):
|
||||
input = input.encode(self.stdin.encoding)
|
||||
while read_set or write_set:
|
||||
try:
|
||||
rlist, wlist, xlist = select.select(read_set, write_set, [])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue