Is there a way prevent tarfile.extractall
(API) from overwriting existing files? By "prevent" I mean ideally raising an exception when an overwrite is about to happen. The current behavior is to silently overwrite the files.
You could check result of tarfile.getnames
against the existing files and raise your error.