
report at bugs
Aug 1, 2012, 10:04 PM
Post #2 of 2
(29 views)
Permalink
|
|
[issue15532] "for line in file" is *still* broken in Python 2.7 on pipes
[In reply to]
|
|
Ned Deily added the comment: Notice in the reply to Issue3907, "with 2.6, you have to use io.open() explicitly". This is still true in Python 2.7, i.e. the new 3.x-compatible io library is not used by default in Python 2. If you want to use it with subprocess.Popen, one way is to supply a pipe with an io wrapper, perhaps something like: import io, os i, o = os.pipe() piperead = io.open(i,'rb',buffering=0) p = subprocess.Popen(..., stdout=o) See Chapter 15 of the Python 2.7 Standard Library doc for more information on the io module: http://docs.python.org/library/io.html ---------- nosy: +ned.deily resolution: -> works for me stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker <report [at] bugs> <http://bugs.python.org/issue15532> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
|