[New-bugs-announce] [issue16903] subprocess.Popen.communicate with universal_newlines=True doesn't accept strings on 3.2

Serhiy Storchaka report at bugs.python.org
Wed Jan 9 10:28:57 CET 2013


New submission from Serhiy Storchaka:

On 3.2 subprocess.Popen.communicate with universal_newlines=True accepts bytes and doesn't accept strings. 

$ ./python -c "import subprocess; subprocess.Popen(['cat'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True).communicate('qwerty')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/serhiy/py/cpython3.2/Lib/subprocess.py", line 833, in communicate
    return self._communicate(input)
  File "/home/serhiy/py/cpython3.2/Lib/subprocess.py", line 1470, in _communicate
    stdout, stderr = self._communicate_with_poll(input)
  File "/home/serhiy/py/cpython3.2/Lib/subprocess.py", line 1537, in _communicate_with_poll
    input_offset += os.write(fd, chunk)
TypeError: 'str' does not support the buffer interface

On 3.3+ it accepts strings and doesn't accept bytes.

----------
components: IO, Library (Lib), Unicode
messages: 179425
nosy: ezio.melotti, serhiy.storchaka
priority: normal
severity: normal
status: open
title: subprocess.Popen.communicate with universal_newlines=True doesn't accept strings on 3.2
type: behavior
versions: Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16903>
_______________________________________


More information about the New-bugs-announce mailing list