This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Using subprocess.STDOUT causes AttributeError
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.0
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, nelchael
Priority: normal Keywords:

Created on 2008-11-22 20:28 by nelchael, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test-subprocess.py nelchael, 2008-11-22 20:28 test-subprocess.py - test case
Messages (2)
msg76258 - (view) Author: Krzysztof Pawlik (nelchael) Date: 2008-11-22 20:28
Using stderr=subprocess.STDOUT causes Python 3.0 (RC1 from Ubuntu 8.10)
to raise AttributeError, important code snippet (whole test program
attached):

proc = subprocess.Popen(['whoami'], stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
stdout, stderr = proc.communicate()


nelchael@nelchael-vbox ~$ python2.5 --version
Python 2.5.2
nelchael@nelchael-vbox ~$ python2.5 test-subprocess.py
('stdout:', 'nelchael\n')
('stderr:', None)
nelchael@nelchael-vbox ~$ python3 --version
Python 3.0rc1+
nelchael@nelchael-vbox ~$ python3 test-subprocess.py
Traceback (most recent call last):
  File "test-subprocess.py", line 4, in <module>
    stdout, stderr = proc.communicate()
  File "/usr/lib/python3.0/subprocess.py", line 663, in communicate
    stdout = self._fo_read_no_intr(self.stdout)
AttributeError: 'Popen' object has no attribute '_fo_read_no_intr'
nelchael@nelchael-vbox ~$
msg76259 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-11-22 20:47
This "_fo_read_no_intr" method does not exist anywhere in the standard 
python code.

A quick Google search reveals that it certainly comes from a patch 
proposed by the Ubuntu maintainers:
http://patches.ubuntu.com/p/python2.5/extracted/subprocess-eintr-
safety.dpatch

It is very likely that this patch (for 2.5) did not apply correctly to 
the 3.0 source code.
In any case, this is not a Python problem.
History
Date User Action Args
2022-04-11 14:56:41adminsetgithub: 48640
2008-11-22 20:47:15amaury.forgeotdarcsetstatus: open -> closed
resolution: not a bug
messages: + msg76259
nosy: + amaury.forgeotdarc
2008-11-22 20:28:03nelchaelcreate