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 韩振宇
Recipients 韩振宇
Date 2020-05-02.11:49:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1588420153.04.0.272722721403.issue40476@roundup.psfhosted.org>
In-reply-to
Content
When I write a long file using write() function, the resulting file is truncated into some specific level when the file is newly establised. However, when the file is existing, the full length can be achieved.

Here is the example code:

f = open('test_output','w')
length = 195364
for i in range(length):
    f.write(str(i)+'\r\n')

On my macOS 10.15.4 and conda virtual environment
conda create -n test python=3.7.4

When the test_output file is not existing, the content of the file is truncated into 195280, while i is 195364 after the writing process.

Then I re-run the code without deleting the file, the output is normal.
History
Date User Action Args
2020-05-02 11:49:13韩振宇setrecipients: + 韩振宇
2020-05-02 11:49:13韩振宇setmessageid: <1588420153.04.0.272722721403.issue40476@roundup.psfhosted.org>
2020-05-02 11:49:13韩振宇linkissue40476 messages
2020-05-02 11:49:12韩振宇create