Edgewall Software

Opened 5 years ago

Last modified 5 years ago

#13122 closed defect

trac.util.tests.html.TracHTMLSanitizerLegacyGenshiTestCase: TypeError: decode() argument 1 must be string, not None — at Initial Version

Reported by: anonymous Owned by:
Priority: normal Milestone: 1.3.4
Component: general Version:
Severity: normal Keywords: genshi
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Running the unit tests I get one failure:

======================================================================
ERROR: test_special_characters_data (trac.util.tests.html.TracHTMLSanitizerLegacyGenshiTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\trac\trunk\trac\util\tests\html.py", line 287, in test_special_characters_data
    test('<p>&amp;</p>',            '<p>&</p>')
  File "c:\trac\trunk\trac\util\tests\html.py", line 336, in _assert_sanitize
    self.assertEqual(expected, self.sanitize(content))
  File "c:\trac\trunk\trac\util\tests\html.py", line 354, in sanitize
    return unicode(HTML(html, encoding='utf-8') | sanitizer)
  File "c:\trac\trunk\trac\util\html.py", line 1251, in HTML
    return Stream(list(parser))
  File "build\bdist.win-amd64\egg\genshi\core.py", line 272, in _ensure
    event = stream.next()
  File "build\bdist.win-amd64\egg\genshi\input.py", line 432, in _coalesce
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "build\bdist.win-amd64\egg\genshi\input.py", line 327, in _generate
    self.feed(data)
  File "c:\python27\Lib\HTMLParser.py", line 117, in feed
    self.goahead(0)
  File "c:\python27\Lib\HTMLParser.py", line 222, in goahead
    self.handle_data("&")
  File "build\bdist.win-amd64\egg\genshi\input.py", line 379, in handle_data
    text = text.decode(self.encoding, 'replace')
TypeError: decode() argument 1 must be string, not None

----------------------------------------------------------------------

Searching for TracHTMLSanitizerLegacyGenshiTestCase finds #12847, but I don't understand if it's related.

Genshi version is 0.6.1.

Change History (0)

Note: See TracTickets for help on using tickets.