I have a program written in python that uploads an archive (zip file) to a remote server. But before uploading it I need to test that it is not corrupted, so I want to execute something like an unzip -t and throw an error if it fails.
Is there something implemented in python that can do that (couldn’t find anything on google), or is there a way to catch the error from my program if I execute the system call unzip -t?
Thanks
Zipfile.testzipis your friend.