[issue33229] Documentation - io — Core tools for working with streams - seek()

Mikhail Zakharov report at bugs.python.org
Thu Apr 5 10:01:46 EDT 2018


Mikhail Zakharov <zmey20000 at yahoo.com> added the comment:

Seems in my, quite old 3.4.5 version, it doesn't work:

$ python3
Python 3.4.5 (default, Jun  1 2017, 13:52:39) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open('/tmp/text.txt', 'r')
>>> f.seek(0, SEEK_END)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'SEEK_END' is not defined
>>> f.close()
>>> 
>>> import os
>>> f = open('/tmp/text.txt', 'r')
>>> f.seek(0, os.SEEK_END)
214
>>> f.close()

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33229>
_______________________________________


More information about the Python-bugs-list mailing list