New submission from Samuel Bayer <s...@mitre.org>:

This bug is probably related to issue 24560.

This:

>>> import subprocess, fcntl, os
>>>> p = subprocess.Popen(["python", "-c", 'import time; time.sleep(5)'], stdin 
>>>> = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE, 
>>>> universal_newlines= True)
>>> fcntl.fcntl(p.stderr.fileno(), fcntl.F_SETFL, os.O_NONBLOCK | 
>>> fcntl.fcntl(p.stderr.fileno(), fcntl.F_GETFL))
>>> p.stderr.read()

causes this:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/codecs.py", 
line 321, in decode
    data = self.buffer + input
TypeError: can't concat NoneType to bytes

I'm assuming the problem is that the underlying unbuffered stream returns None 
and the incremental byte decoder that's induced by universal_newlines = True 
isn't expecting it.

----------
components: IO
messages: 333883
nosy: sambayer
priority: normal
severity: normal
status: open
title: subprocess.Popen with universal_newlines and nonblocking streams failes 
with "can't concat NoneType to bytes"
type: crash
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35762>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to