Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

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.

----------
components: +IO
nosy: +serhiy.storchaka
type: crash -> behavior

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34904>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to