Message273158
With Python 2, the following call worked:
open('/dev/stdout', 'a')
Users of Supervisor have been depending on that for a long time.
With Python 3.5, this is what happens:
>>> open('/dev/stdout', 'a')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 29] Illegal seek
Presumably, this happens because Python 3 opens the file in 'w' mode and seeks to the end, while Python 2 passed the 'a' flag directly to the underlying C library; the underlying library is apparently smart enough to treat 'a' and 'w' identically when opening character device files and FIFOs.
It's a nasty little surprise for those upgrading from Python 2. |
|
Date |
User |
Action |
Args |
2016-08-19 20:11:12 | hathawsh | set | recipients:
+ hathawsh |
2016-08-19 20:11:12 | hathawsh | set | messageid: <1471637472.92.0.246311076418.issue27805@psf.upfronthosting.co.za> |
2016-08-19 20:11:12 | hathawsh | link | issue27805 messages |
2016-08-19 20:11:12 | hathawsh | create | |
|