Message206957
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. |
|
Date |
User |
Action |
Args |
2013-12-26 20:01:49 | Dolda2000 | set | recipients:
+ Dolda2000 |
2013-12-26 20:01:49 | Dolda2000 | set | messageid: <1388088109.09.0.0894725958863.issue20074@psf.upfronthosting.co.za> |
2013-12-26 20:01:49 | Dolda2000 | link | issue20074 messages |
2013-12-26 20:01:48 | Dolda2000 | create | |
|