Regression in bs4 4.4.0 when manipulating html document

Bug #1474732 reported by Jozef Mlich
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Beautiful Soup
New
Undecided
Unassigned

Bug Description

Please read more details in red hat buzilla.
https://bugzilla.redhat.com/show_bug.cgi?id=1242599

Revision history for this message
Fake Name (lemuix) wrote :

I can confirm something that looks a /lot/ like this same issue:

Traceback (most recent call last):
  File "/media/Storage/Scripts/ReadableWebProxy/WebMirror/processor/HtmlProcessor.py", line 290, in decomposeItems
    have = soup.find_all(True, attrs=key)
  File "/media/Storage/Scripts/ReadableWebProxy/flask/lib/python3.4/site-packages/bs4/element.py", line 1255, in find_all
    return self._find_all(name, attrs, text, limit, generator, **kwargs)
  File "/media/Storage/Scripts/ReadableWebProxy/flask/lib/python3.4/site-packages/bs4/element.py", line 533, in _find_all
    found = strainer.search(i)
  File "/media/Storage/Scripts/ReadableWebProxy/flask/lib/python3.4/site-packages/bs4/element.py", line 1642, in search
    found = self.search_tag(markup)
  File "/media/Storage/Scripts/ReadableWebProxy/flask/lib/python3.4/site-packages/bs4/element.py", line 1613, in search_tag
    attr_value = markup_attr_map.get(attr)
  File "/media/Storage/Scripts/ReadableWebProxy/flask/lib/python3.4/site-packages/bs4/element.py", line 943, in get
    return self.attrs.get(key, default)
AttributeError: 'NoneType' object has no attribute 'get'

In this case, I'm doing some heavy permutation of the HTML tree, decomposing a number of elements. I can confirm the tree is non-None, and the same code works fine when I roll back to 4.3.2, so it looks like this is indeed a regression.

I can't pull out a nice test-case for the moment (too many dependencies), but I can see if I can get something together next weekend.

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.