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.

Author Dolda2000
Recipients Dolda2000
Date 2013-12-26.20:01:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1388088109.09.0.0894725958863.issue20074@psf.upfronthosting.co.za>
In-reply-to
Content
It seems open() is slightly broken in Python 3, in that one cannot open non-seekable files in read-write mode. One such common use is open("/dev/tty", "r+") for interacting directly with the controlling TTY regardless of standard stream redirections. Note that this is a regression for Python 2, where this worked as expected.

What happens is the following:
>>> open("/dev/tty", "r+")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
io.UnsupportedOperation: File or stream is not seekable.

Just for the record, the same thing happens with "w+" and "rb+".

This also means that the getpass module is slightly broken, since it will always fail whenever stdin is redirected.
History
Date User Action Args
2013-12-26 20:01:49Dolda2000setrecipients: + Dolda2000
2013-12-26 20:01:49Dolda2000setmessageid: <1388088109.09.0.0894725958863.issue20074@psf.upfronthosting.co.za>
2013-12-26 20:01:49Dolda2000linkissue20074 messages
2013-12-26 20:01:48Dolda2000create