chm2pdf crashed if BeautifulSoup is used but not installed

Bug #630520 reported by Chen Liang
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
chm2pdf (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Binary package hint: chm2pdf

I was converting, here is what I got:

Traceback (most recent call last):
  File "/usr/bin/chm2pdf", line 1108, in <module>
    main(sys.argv)
  File "/usr/bin/chm2pdf", line 1102, in main
    convert_to_pdf(cfile, filename, outputfilename, options)
  File "/usr/bin/chm2pdf", line 387, in convert_to_pdf
    correct_file(re.sub('\\\\ ', ' ', page_filename), htmlout_filename, html_list, objective_urls, options)
  File "/usr/bin/chm2pdf", line 137, in correct_file
    from BeautifulSoup import BeautifulSoup, Tag
ImportError: No module named BeautifulSoup

ProblemType: Crash
DistroRelease: Ubuntu 10.10
Package: chm2pdf 0.9.1-1.1ubuntu4
ProcVersionSignature: Ubuntu 2.6.35-19.28-generic 2.6.35.3
Uname: Linux 2.6.35-19-generic i686
NonfreeKernelModules: wl
Architecture: i386
Date: Sun Sep 5 00:27:33 2010
ExecutablePath: /usr/bin/chm2pdf
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Beta i386 (20100901.1)
InterpreterPath: /usr/bin/python2.6
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/chm2pdf --book --beautifulsoup Hacking\ Exposed,\ 5th\ Edition.chm
ProcEnviron:
 SHELL=/bin/bash
 LANG=en_IE.utf8
PythonArgs: ['/usr/bin/chm2pdf', '--book', '--beautifulsoup', 'Hacking Exposed, 5th Edition.chm']
SourcePackage: chm2pdf
Title: chm2pdf crashed with ImportError in correct_file()
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Revision history for this message
Chen Liang (chenliang) wrote :
tags: removed: need-duplicate-check
Chen Liang (chenliang)
visibility: private → public
Revision history for this message
Reto Knaak (reto-knaak) wrote :

Do you get the same if the filename contains no spaces?

Revision history for this message
Reto Knaak (reto-knaak) wrote :

You used the --beautifulsoup option but you didn't install beautifulsoup which is optional maybe?

Revision history for this message
Reto Knaak (reto-knaak) wrote :

Beautifulsoup is an optional package, if you don'use it, no need to install it.
If you install chm2pdf you don't get beautifulsoup automatically.

If the --beautifulsoup option is passed, CHM2PDF executes
 from BeautifulSoup import BeautifulSoup, Tag
and this will rise an exception.

I added the code to intercept this exception generating some help
+ try:
+ from BeautifulSoup import BeautifulSoup
+ except Exception, e:
+ print
+ print '### An error occured importing soup ', e
+ print '### Check if beautifulsoup is installed or remove --beautifulsoup from the command line'
+ sys.exit()

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Check if beautifulsoup is installed before importing it!" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Reto Knaak (reto-knaak)
Changed in chm2pdf (Ubuntu):
status: New → Confirmed
Reto Knaak (reto-knaak)
summary: - chm2pdf crashed with ImportError in correct_file()
+ chm2pdf crashed if BeautifulSoup is used but not installed
Changed in chm2pdf (Ubuntu):
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.