You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pylint assumes that Popen().communicate() returns a tuple of 2 "str" instance, but this is incorrect in Python 3 where it returns a tuple of 2 "bytes" instances, unless universal_newlines=True is passed to Popen, in which case it returns a tuple of 2 "str" instances again.
Originally reported by: Anonymous
Pylint assumes that Popen().communicate() returns a tuple of 2 "str" instance, but this is incorrect in Python 3 where it returns a tuple of 2 "bytes" instances, unless universal_newlines=True is passed to Popen, in which case it returns a tuple of 2 "str" instances again.
$ cat subprocess_test.py
from subprocess import Popen, PIPE
stdout, stderr = Popen('/bin/ls', stdout=PIPE).communicate()
print(stdout.decode("ascii"))
$ pylint -d C -r n subprocess_test.py
************* Module subprocess_test
E: 3, 6: Instance of 'str' has no 'decode' member (no-member)
Python 3 runs the code fine.
I wonder if this is related to the "brain" package included in asteroid, as in the asteroid package:
$ grep -A 12 Popen brain/py2stdlib.py
class Popen(object):
returncode = pid = 0
stdin = stdout = stderr = file()
The text was updated successfully, but these errors were encountered: