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
The subprocess module in Python 2.5 can redirect the output of the executed
program to an internal buffer. Example:
import os,subprocess,multiprocessing
def f():
p = subprocess.Popen(['echo', '-n', 'pss'], stdout=subprocess.PIPE)
out = p.communicate()
print(repr(out))
pr = multiprocessing.Process(target=f)
pr.start()
With python2.5, this outputs (None, None). python2.6 with native
multiprocessing yields the correct ('pss', None).
Workaround: Use one of the os.popen functions:
def f():
streams = os.popen3('echo -n psss')
out = (streams[1].read(), streams[2].read())
print(repr(out))
pr = multiprocessing.Process(target=f)
pr.start()
yields ('psss, '') in python2.5 and python2.6.
Original issue reported on code.google.com by phihag.de@gmail.com on 27 Jun 2009 at 9:10
The text was updated successfully, but these errors were encountered:
See this issue, which will be fixed in python 2.7:
http://bugs.python.org/issue5313
I do not know when a backport is released, although I'd be glad to help.
Original comment by g2p.c...@gmail.com on 2 Jul 2009 at 1:36
Original issue reported on code.google.com by
phihag.de@gmail.com
on 27 Jun 2009 at 9:10The text was updated successfully, but these errors were encountered: