Bugs!

7 views
Skip to first unread message

stoneguy

unread,
Jan 17, 2011, 4:27:26 PM1/17/11
to chm2pdf
Am trying to convert a book. Hope this project is still active!

1st problem encountered was correct_file() being called with the name
of a directory rather than a file. Grabbed a local copy of chm2pdf and
modded to no-op that case. (I have limited exposure to Python
programming.)

Processing continued for htm, css, and png files until correct_file
was passed a file named FamilyPsych.jpg. Looks like the jpeg was
passed to sgmllib.py, which blew up trying to interpret the bitmap as
sgml. Here's the relevant traceback

Correcting /tmp/tmpxOKBKd/x/FamilyPsych.jpg
Traceback (most recent call last):
File "/home/russ/bin/chm2pdf", line 1110, in <module>
main(sys.argv)
File "/home/russ/bin/chm2pdf", line 1104, in main
convert_to_pdf(cfile, filename, outputfilename, options)
File "/home/russ/bin/chm2pdf", line 389, in convert_to_pdf
correct_file(re.sub('\\\\ ', ' ', page_filename),
htmlout_filename, html_list, objective_urls, options)
File "/home/russ/bin/chm2pdf", line 142, in correct_file
image_catcher.feed(page)
File "/usr/lib/python2.6/sgmllib.py", line 104, in feed
self.goahead(0)
File "/usr/lib/python2.6/sgmllib.py", line 174, in goahead
k = self.parse_declaration(i)
File "/usr/lib/python2.6/markupbase.py", line 98, in
parse_declaration
decltype, j = self._scan_name(j, i)
File "/usr/lib/python2.6/markupbase.py", line 388, in _scan_name
% rawdata[declstartpos:declstartpos+20])
File "/usr/lib/python2.6/sgmllib.py", line 111, in error
raise SGMLParseError(message)
sgmllib.SGMLParseError: expected name token at '<!\xe1\xef\nx0\xeb\x1e
\x1b\xd2\xe3\xd3\xee\xd6\xe5"2\xab\x12'

Guy

Chris Karakas

unread,
Feb 8, 2011, 10:57:41 AM2/8/11
to chm...@googlegroups.com
I don't know why sgmllib.py gets to parse FamilyPsych.jpg - maybe you can post the command line you used...

-- 
Regards

Chris Karakas
http://www.karakas-online.de

-----Ursprüngliche Nachricht-----
Von: stoneguy <ston...@gmail.com>
Gesendet: Jan 17, 2011 10:27:26 PM
An: chm2pdf <chm...@googlegroups.com>
Betreff: Bugs!

>--
>Hai ricevuto questo messaggio perché sei iscritto al gruppo "chm2pdf" di Google Gruppi.
>Per postare messaggi in questo gruppo, invia un'email a chm...@googlegroups.com.
>Per annullare l'iscrizione a questo gruppo, invia un'email a chm2pdf+u...@googlegroups.com.
>Per ulteriori opzioni, visita il gruppo all'indirizzo http://groups.google.com/group/chm2pdf?hl=it.
>

Reply all
Reply to author
Forward
0 new messages