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 andrei.avk
Recipients alanmcintyre, andrei.avk, longavailable, serhiy.storchaka, twouters
Date 2021-08-23.20:32:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629750765.08.0.799546395901.issue41102@roundup.psfhosted.org>
In-reply-to
Content
Liu: apologies for the confusion, I missed that when coming back to the thread for the 2nd time.

I took a look at the code and one potential issue I see is that you are opening the file in 'w' mode if stat size is 0 (or if file isn't valid), and in 'a' mode otherwise. It's better to just use the 'a' mode as then the file will be created if it doesn't exist.

This may lead to file being opened in 'w' mode after some files already were meant to be written, - due to buffering.

A second issue is that you're closing and reopening the archive for each file written. I'm not sure if you had a reason for that but it's better to open the archive and write all of the files if you have them ready.

It's hard to say exactly what lead to this incomplete archive without a reproducible way to create it.
History
Date User Action Args
2021-08-23 20:32:45andrei.avksetrecipients: + andrei.avk, twouters, alanmcintyre, serhiy.storchaka, longavailable
2021-08-23 20:32:45andrei.avksetmessageid: <1629750765.08.0.799546395901.issue41102@roundup.psfhosted.org>
2021-08-23 20:32:45andrei.avklinkissue41102 messages
2021-08-23 20:32:45andrei.avkcreate