davideuler / chm2pdf

Automatically exported from code.google.com/p/chm2pdf
GNU General Public License v2.0
0 stars 0 forks source link

OError: [Errno 21] Is a directory #26

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Normal --book conversion
2.
3.

What is the expected output? What do you see instead?
Converted PDF

What version of the product are you using? On what operating system?
0.9.1-1.1ubuntu1, ubuntu linux

Please provide any additional information below.

chm2pdf --book haha.chm 
Traceback (most recent call last):
  File "/usr/bin/chm2pdf", line 1098, in <module>
    main(sys.argv)
  File "/usr/bin/chm2pdf", line 1092, in main
    convert_to_pdf(cfile, filename, outputfilename, options)
  File "/usr/bin/chm2pdf", line 386, in convert_to_pdf
    correct_file(page_filename, htmlout_filename, html_list,
objective_urls, options)
  File "/usr/bin/chm2pdf", line 131, in correct_file
    pf=open(input_file,'rU')
IOError: [Errno 21] Is a directory: '/tmp/tmpr7s2RQ/haha/'

Original issue reported on code.google.com by tomaz.markelj@gmail.com on 21 Oct 2009 at 10:06

GoogleCodeExporter commented 9 years ago
I think I have a partial fix for this.
In the get_html_list function if we filter out the pages list and only grab 
html files this works.

Seems it was trying to work on all entities including things like "/" and files 
that aren't html like ".zip".
If we filter it out with something like:
lister.pages = filter (lambda a: '.html' in a, lister.pages)
We then get a nicely formed PDF.

The only problem now is that images don't seem to make the cut, at least in the 
chm I tested... but I didn't have a way to test to see if the original images 
worked anyway.  I have attached my patched chm2pdf.py file for now.

Original comment by Matthew....@gmail.com on 22 Dec 2010 at 4:51

Attachments:

GoogleCodeExporter commented 9 years ago
Oh and this isn't just with the book switch, but any conversion it seems.

Still didn't take a look at making sure the images stay in there, but probably 
best to split up the lists and filter for each.

Original comment by Matthew....@gmail.com on 24 Dec 2010 at 3:17