Bug 967184 - [abrt] chm2pdf-0.9.1-11.fc17: sgmllib.py:103:feed:TypeError: cannot concatenate 'str' and 'NoneType' objects
[abrt] chm2pdf-0.9.1-11.fc17: sgmllib.py:103:feed:TypeError: cannot concatena...
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: python (Show other bugs)
17
i686 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Bohuslav "Slavek" Kabrda
Fedora Extras Quality Assurance
abrt_hash:3b5dd13f37914f047303a840b27...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-25 05:49 EDT by Didier Couderc
Modified: 2013-07-31 16:19 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-31 16:19:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
File: backtrace (718 bytes, text/plain)
2013-05-25 05:49 EDT, Didier Couderc
no flags Details
File: core_backtrace (389 bytes, text/plain)
2013-05-25 05:49 EDT, Didier Couderc
no flags Details
File: environ (1.47 KB, text/plain)
2013-05-25 05:49 EDT, Didier Couderc
no flags Details
File: smolt_data (3.69 KB, text/plain)
2013-05-25 05:49 EDT, Didier Couderc
no flags Details

  None (edit)
Description Didier Couderc 2013-05-25 05:49:11 EDT
Version-Release number of selected component:
chm2pdf-0.9.1-11.fc17

Additional info:
cmdline:        /usr/bin/python /usr/bin/chm2pdf --book ./Design_Patterns.Elements_of_Reusable_Object_Oriented_Software.Gang_of_Four.Gamma.Helm.Johnson.Vli.chm
dso_list:       python-libs-2.7.3-7.2.fc17.i686
executable:     /usr/bin/chm2pdf
kernel:         3.8.12-100.fc17.i686.PAE
uid:            1000
ureports_counter: 1

Truncated backtrace:
sgmllib.py:103:feed:TypeError: cannot concatenate 'str' and 'NoneType' objects

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 317, in convert_to_pdf
    html_list=get_html_list(cfile)
  File "/usr/bin/chm2pdf", line 106, in get_html_list
    lister.feed(topicstree)
  File "/usr/lib/python2.7/sgmllib.py", line 103, in feed
    self.rawdata = self.rawdata + data
TypeError: cannot concatenate 'str' and 'NoneType' objects

Local variables in innermost frame:
self: <__main__.PageLister instance at 0xb73bb28c>
data: None
Comment 1 Didier Couderc 2013-05-25 05:49:14 EDT
Created attachment 752965 [details]
File: backtrace
Comment 2 Didier Couderc 2013-05-25 05:49:17 EDT
Created attachment 752966 [details]
File: core_backtrace
Comment 3 Didier Couderc 2013-05-25 05:49:20 EDT
Created attachment 752967 [details]
File: environ
Comment 4 Didier Couderc 2013-05-25 05:49:23 EDT
Created attachment 752968 [details]
File: smolt_data
Comment 5 Pavel Alexeev 2013-06-01 17:08:12 EDT
It is happened in Python library itself.
Comment 6 Thomas Spura 2013-06-03 06:06:07 EDT
From chm2pdf:
def get_html_list(cfile):
    '''
    retrieves the list of HTML files contained into the CHM file, **in order** (that's the important bit).
    (actually performed by the PageLister class)
    '''
    topicstree=cfile.GetTopicsTree()
    lister=PageLister()
    lister.feed(topicstree)
    #print 'lister pages',lister.pages
    return lister.pages

When topicstree is None, feeding it into sgmllib will fail, but I believe that is expected.

It woul be better to only feed it tot he lister, when topicstree is not None.
Comment 7 Pavel Alexeev 2013-06-13 15:36:41 EDT
Ok, I try replace it by:

    topicstree=cfile.GetTopicsTree()
    if None != topicstree:
        lister=PageLister()
        lister.feed(topicstree)
        #print 'lister pages',lister.pages
        return lister.pages
    return None

But it still fails in SGML library:
$ chm2pdf --book t.chm
Traceback (most recent call last):
  File "/usr/bin/chm2pdf", line 1118, in <module>
    main(sys.argv)
  File "/usr/bin/chm2pdf", line 1112, in main
    convert_to_pdf(cfile, filename, outputfilename, options)
  File "/usr/bin/chm2pdf", line 402, in convert_to_pdf
    correct_file(page_filename, htmlout_filename, html_list, objective_urls, options)
  File "/usr/bin/chm2pdf", line 154, in correct_file
    image_catcher.feed(page)
  File "/usr/lib64/python2.7/sgmllib.py", line 104, in feed
    self.goahead(0)
  File "/usr/lib64/python2.7/sgmllib.py", line 174, in goahead
    k = self.parse_declaration(i)
  File "/usr/lib64/python2.7/markupbase.py", line 98, in parse_declaration
    decltype, j = self._scan_name(j, i)
  File "/usr/lib64/python2.7/markupbase.py", line 392, in _scan_name
    % rawdata[declstartpos:declstartpos+20])
  File "/usr/lib64/python2.7/sgmllib.py", line 111, in error
    raise SGMLParseError(message)
sgmllib.SGMLParseError: expected name token at '<!\xcd\xbf:J\x86\xdb\xcd\x1b]\x9b\xf1sWif\xbe\x1fC'
Comment 8 Thomas Spura 2013-06-14 04:39:20 EDT
Hmm, could you upload an example chm, where it fails (with and without the patch)?

I'd try to have a look soon then.
Comment 9 Pavel Alexeev 2013-06-17 16:41:26 EDT
Please look at file in BZ#869041.
Comment 10 Fedora End Of Life 2013-07-03 16:25:07 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 11 Fedora End Of Life 2013-07-31 16:19:55 EDT
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.