This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author liugang93
Recipients liugang93
Date 2018-11-23.19:44:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1543002277.59.0.788709270274.issue35304@psf.upfronthosting.co.za>
In-reply-to
Content
# 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
History
Date User Action Args
2018-11-23 19:44:37liugang93setrecipients: + liugang93
2018-11-23 19:44:37liugang93setmessageid: <1543002277.59.0.788709270274.issue35304@psf.upfronthosting.co.za>
2018-11-23 19:44:37liugang93linkissue35304 messages
2018-11-23 19:44:37liugang93create