Message327128
This may be a Linux bug. The /dev/null file is seekable, but seek() doesn't work correctly for it. It is especially confusing for buffered files. seek() always returns 0 and reset the file position.
>>> f = open('/dev/null', 'wb')
>>> f.seekable()
True
>>> f.tell()
0
>>> f.write(b'abcdefgh')
8
>>> f.tell()
8
>>> f.seek(8)
0
>>> f.tell()
0
In contrary, files like /dev/stdout are not seekable, and writing a ZIP file to them works properly. |
|
Date |
User |
Action |
Args |
2018-10-05 11:51:38 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, erik.bray, xtreak |
2018-10-05 11:51:38 | serhiy.storchaka | set | messageid: <1538740298.57.0.545547206417.issue34904@psf.upfronthosting.co.za> |
2018-10-05 11:51:38 | serhiy.storchaka | link | issue34904 messages |
2018-10-05 11:51:38 | serhiy.storchaka | create | |
|