Serhiy Storchaka added the comment:
This is because the file is buffered.
>>> open('temp.txt', 'w').write('ABCDE\nFGHIJ\nKLMNO\nPQRST\nUVWXY\nZ\n')
32
>>> f = open('temp.txt', 'r+')
>>> f.readline()
'ABCDE\n'
>>> f.tell()
6
>>> f.buffer.tell()
32
>>> f.buffer.raw.tell()
32
The documentation needs a clarification.
----------
assignee: -> docs@python
components: +Documentation
nosy: +benjamin.peterson, docs@python, haypo, pitrou, serhiy.storchaka,
steve.dower, stutzbach
versions: +Python 2.7, Python 3.6 -Python 3.4
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26158>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com