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.

Author LambertDW
Recipients LambertDW
Date 2011-10-17.15:03:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1318863796.84.0.712149290856.issue13202@psf.upfronthosting.co.za>
In-reply-to
Content
There are a number of issues with subprocess and __exit__ , 12494 status fixed among them.

Program (which doesn't work as I had hoped, but that's not the issue):


'file p.py'

import subprocess as S

with S.Popen(('cat','-n',),shell=False,stdin=S.PIPE,stdout=S.PIPE,bufsize=1,universal_newlines=True) as p:
    p.stdin.write('these\n')
    print(p.stdout.readline())




Use:

$ python3 p.py

Traceback (most recent call last):
  File "p.py", line 5, in <module>
    print(p.stdout.readline())
KeyboardInterrupt
$
$ python p.py
Traceback (most recent call last):
  File "p.py", line 3, in <module>
    with S.Popen(('cat','-n',),shell=False,stdin=S.PIPE,stdout=S.PIPE,bufsize=1,universal_newlines=True) as p:
AttributeError: __exit__
$
$ python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
History
Date User Action Args
2011-10-17 15:03:16LambertDWsetrecipients: + LambertDW
2011-10-17 15:03:16LambertDWsetmessageid: <1318863796.84.0.712149290856.issue13202@psf.upfronthosting.co.za>
2011-10-17 15:03:16LambertDWlinkissue13202 messages
2011-10-17 15:03:15LambertDWcreate