Feb. 23, 2015
9:38 p.m.
On 23 February 2015 at 21:02, Brett Cannon <brett@python.org> wrote:
The real problem with overwriting is if there's a failure during the overwrite you lose the original file. My original API had overwrite as the default, but I think the risk makes that a bad idea.
Couldn't you catch the exception, write the original file back out, and then re-raise the exception?
But you don't *have* the original file. You read the source archive entry-by-entry, not all at once. Apart from the implementation difficulty, this is getting too complex, and I think it's better to just give the user the tools to add whatever robustness or exception handling they want on top. Paul