[issue3207] file.write() after file.readline() in mode "r+"

Peter report at bugs.python.org
Thu Jun 26 14:00:00 CEST 2008


Peter <poslano at gmail.com> added the comment:

Amaury Forgeot d'Arc, your example really raise IOError 0
Thing is that you had 1 string in the file
Here is it:
>>> open("delete.me", "w").write("first\nsecond\nthird")
>>> fp = open("delete.me", "r+t")
>>> fp.readline()
'first\n'
>>> fp.write("Newbie")
>>> fp.close()
>>> open("delete.me", "r").read()
'first\nsecond\nthird'

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3207>
_______________________________________


More information about the Python-bugs-list mailing list