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.

classification
Title: subprocess's popen.stdout.seek(0) doesn't raise an error
Type: enhancement Stage:
Components: Windows Versions: Python 3.2
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, amaury.forgeotdarc, brian.curtin, christian.heimes, giampaolo.rodola, pitrou, tim.golden
Priority: normal Keywords:

Created on 2007-11-16 14:56 by christian.heimes, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg57585 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-16 14:56
On Linux:

>>> p = subprocess.Popen("ls", stdout=subprocess.PIPE)
>>> p.stdout.read()
b'...'
>>> p.stdout.seek(0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/heimes/dev/python/py3k/Lib/io.py", line 809, in seek
    pos = self.raw.seek(pos, whence)
IOError: [Errno 29] Illegal seek
>>> p.stdout.read()
b''

On Windows p.stdout.seek(0) does neither raise an error nor works as one
might expect it. The second read() returns an empty byte string, too.
msg57593 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2007-11-16 19:45
Python 2.5 on Windows has the same behaviour, it does not fail.
In general, python does not try to hide this kind of differences.
msg116789 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-09-18 14:53
@Brian/Tim what would you expect to happen here?
msg125271 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-01-04 01:12
Looks like it's a platform bug, nothing Python can do about.
History
Date User Action Args
2022-04-11 14:56:28adminsetgithub: 45793
2011-01-04 01:12:59pitrousetstatus: open -> closed

nosy: + pitrou
messages: + msg125271

resolution: rejected
2010-09-18 14:53:32BreamoreBoysetnosy: + tim.golden, brian.curtin, BreamoreBoy
messages: + msg116789
2010-06-18 00:03:26giampaolo.rodolasetnosy: + giampaolo.rodola
2010-06-10 23:16:42belopolskysettype: enhancement
versions: + Python 3.2, - Python 3.0
2008-01-06 22:29:45adminsetkeywords: - py3k
versions: Python 3.0
2007-11-20 00:45:18christian.heimessetpriority: normal
2007-11-16 19:45:10amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg57593
2007-11-16 14:56:48christian.heimescreate