thorstenb / odpdown

Generate OpenDocument Presentation (odp) files from markdown
Other
107 stars 18 forks source link

ERROR "corrupted or not an OpenDocument archive" #47

Open nnako opened 6 years ago

nnako commented 6 years ago

Hi,

I get an error "corrupted or not an OpenDocument archive" when trying to run the tool on my Windows-7 machine.

This is what I did so far:

python odpdown.py ^
   --break-master=<SlideName1> ^
   --content-master=<SlideName2> ^
   -s friendly ^
   <inputfile> ^
   <templatefile> ^
   <outputfile>

where the contents of the angular-bracketed params <inputfile> and <templatefile> were set to corresponding files found in the demo\ folder of the repo. After receiving the error message (see above), I thought, I made some errors, so I double checked everything and by that tried to solve this by e.g.:

But no change. The error occurrs in row no. 798 of the odpdown.py file. when calling lpod.document.odf_get_document():

presentation = odf_get_document(odf_in)

I checked odf_in to be the template's file name.

Any suggestions? Might the OpenDocument specification change and thus break this tool?

Thanks.

Timur-P commented 5 years ago

Well, after three hours debugging I can suggest the fix. Here parser.add_argument('template_odp', type=argparse.FileType('r'), help='Input ODP template file') parser.add_argument('output_odp', type=argparse.FileType('w'), help='Output ODP file') replace r with rb and w with wb, with r it incorrectly reads presentation file, and thus it can't be parsed by zipfile library.