Skip to main content
Question

ZipArchiver truncates xml file while zipping


s.jager
Influencer
Forum|alt.badge.img+26

So I have a process that extracts data from a database, converts that data into a fairly complex xml, downloads a PDF from Sharepoint, and at the end it uses the ZipArchiver to add both PDF and XML to a zipfile. This works fine, except that at some point in time the XML in the zipfile is truncated. This of course results in invalid xml, so it is not accepted downstream. The file itself is fine, since I leave that in it’s original location that’s easy to check. Somewhere inside the ZipArchiver or inside the zip the XML is cut off. It does not seem to have to do with the number of characters in the xml, since it differs between various zipfiles as tohow many characters of the xml have survived. Strangely enough the PDF inside the same zipfile is fine, usually many times larger than the xml (one example has a 39.2 Mb PDF, and a 349kB xml...), so I don’t think it’s the filesize (unless 349 is too small...).

 

Has anybody else seen this before? I’ve been looking at the Python-code inside the ZipArchiver, but I do not see anything suspicious.