Wednesday, October 31, 2012

BeautifulSoup v4.1.3 patch

Apparently a tag such as the following will break BeautifulSoup when using HTML5lib:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

  File "/home/external/html5lib/treebuilders/_base.py", line 291, in insertElementNormal
    element.attributes = token["data"]
  File "/home/external/bs4/builder/_html5lib.py", line 147, in setAttributes
    new_name = NamespacedAttribute(*name)
  File "/home/external/bs4/element.py", line 30, in __new__
    obj = unicode.__new__(cls, prefix + ":" + name)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
https://bugs.launchpad.net/beautifulsoup/+bug/1073810

No comments:

Post a Comment