[New-bugs-announce] [issue3524] IOError when attempting negative seek in file (Python 3.0 tutorial)
Jim Sizelove
report at bugs.python.org
Fri Aug 8 02:42:35 CEST 2008
New submission from Jim Sizelove <jimsize at gmail.com>:
The Input and Output section of the Python 3.0 tutorial
(http://docs.python.org/dev/3.0/tutorial/inputoutput.html) shows an
example of seeking in a negative direction from the end of a file. I
get an IOError when attempting to run the example in Python 3.0b2 on Mac
OS X 10.4 (PPC). I don't know whether the tutorial or the code should
be changed.
>>> f = open('workfile', 'r+')
>>> f.write('0123456789abcdef')
16
>>> f.seek(-3, 2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/Users/jimsize/Programming/Python/py3k/3.0b2/lib/python3.0/io.py", line
1609, in seek
raise IOError("can't do nonzero end-relative seeks")
IOError: can't do nonzero end-relative seeks
----------
assignee: georg.brandl
components: Documentation
messages: 70874
nosy: georg.brandl, jsizelove
severity: normal
status: open
title: IOError when attempting negative seek in file (Python 3.0 tutorial)
type: behavior
versions: Python 3.0
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3524>
_______________________________________
More information about the New-bugs-announce
mailing list