[issue12877] Popen(...).stdout.seek(...) throws "Illegal seek"

2011-09-01 Thread STINNER Victor
STINNER Victor added the comment: > Why does it have a 'seek' method then? Python doesn't remove a method if the operation is forbidden. For example, Python doesn't remove write() method if the file is read only, and it doesn't remove most methods after close(). I prefer to have files with a

[issue12877] Popen(...).stdout.seek(...) throws "Illegal seek"

2011-09-01 Thread Jonas H.
Jonas H. added the comment: Why does it have a 'seek' method then? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue12877] Popen(...).stdout.seek(...) throws "Illegal seek"

2011-09-01 Thread STINNER Victor
STINNER Victor added the comment: stdout is a PIPE. You cannot seek in a PIPE. Write stdout into a file, or use maybe BytesIO or StringIO? -- nosy: +haypo resolution: -> invalid status: open -> closed ___ Python tracker

[issue12877] Popen(...).stdout.seek(...) throws "Illegal seek"

2011-09-01 Thread Nadeem Vawda
Nadeem Vawda added the comment: This is expected behaviour - you cannot seek on a pipe. -- nosy: +nadeem.vawda ___ Python tracker ___ ___

[issue12877] Popen(...).stdout.seek(...) throws "Illegal seek"

2011-09-01 Thread Jonas H.
New submission from Jonas H. : from subprocess import Popen, PIPE p = Popen(['ls'], stdout=PIPE) p.wait() p.stdout.seek(0) Traceback (most recent call last): File "t.py", line 5, in p.stdout.seek(0) IOError: [Errno 29] Illegal seek Python 2.7.2, Arch Linux x86-64 (Kernel 3.0) -