[issue7240] subprocess.Popen.stdout.flush fails os OS-X 10.6.1

2009-11-03 Thread Philip Jenvey
Changes by Philip Jenvey : -- resolution: -> invalid status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue7240] subprocess.Popen.stdout.flush fails os OS-X 10.6.1

2009-11-02 Thread Ronald Oussoren
Ronald Oussoren added the comment: I don't think so. stdio on OSX has a fdiscard function, but that's not exposed to Python. I tend to explicitly synchronize on prompts when communicating with an interactive program over a pipe. That is, read until you found the prompt, then send a command,

[issue7240] subprocess.Popen.stdout.flush fails os OS-X 10.6.1

2009-10-30 Thread Peter Gibson
Peter Gibson added the comment: Not my code, but as it's using a pipe to communicate with another process, I assume that the flush call is intended to discard any unwanted output prior to sending a command and processing the result. Is there another way to achieve the same effect, such as readi

[issue7240] subprocess.Popen.stdout.flush fails os OS-X 10.6.1

2009-10-29 Thread Ned Deily
Ned Deily added the comment: Philip is correct: >>> p.stdout.flush() Traceback (most recent call last): File "", line 1, in IOError: [Errno 9] Bad file descriptor >>> p.stdout ', mode 'rb' at 0x100527470> You'll get the same error on OS X (at least as far back as Python 2.3.5 on OS X 10.4)

[issue7240] subprocess.Popen.stdout.flush fails os OS-X 10.6.1

2009-10-29 Thread Philip Jenvey
Philip Jenvey added the comment: Why are you flushing stdout? It's read-only and flush is for writing. This behavior is dependent on the underlying platform's fflush, which really *should* be raising EBADF when fflushing a read only file, anyway -- nosy: +pjenvey

[issue7240] subprocess.Popen.stdout.flush fails os OS-X 10.6.1

2009-10-29 Thread Peter Gibson
New submission from Peter Gibson : subprocess.Popen.stdout.flush() fails on OS-X 10.6.1 under the bundled Python 2.6.1 and 2.6.3 from Macports. >>> from subprocess import Popen, PIPE >>> p = Popen('cat', stdin=PIPE, stdout=PIPE) >>> p.stdout.flush() Traceback (most recent call last): File "",