liugang <liugan...@163.com> added the comment:
# Run in Windows 10 # Code snippet 1 f = open('test', "w+") f.write('xxx\nyyy\nzzz') f.seek(0) f.readline() print(f.tell()) # 5 x = f.truncate() print(x) # 13 - why it is 13, not 5? # Code snippet 2 f = open('test', "w+") f.write('xxx\nyyy\nzzz') f.seek(0) f.readline() print(f.tell()) # 5 f.seek(f.tell()) x = f.truncate() print(x) # 5 ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35304> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com