How to update one file inside zip file? [duplicate]
Updating a file in a ZIP is not supported. You need to rebuild a new archive without the file, then add the updated version. import os import zipfile import tempfile def updateZip(zipname, filename, data): # generate a temp file tmpfd, tmpname = tempfile.mkstemp(dir=os.path.dirname(zipname)) os.close(tmpfd) # create a temp copy of the archive without filename with … Read more