Beautiful Soup 4.15.0

12 views
Skip to first unread message

leonardr

unread,
Jun 7, 2026, 12:51:33 PM (3 days ago) Jun 7
to beautifulsoup
= 4.15.0 (20260607)

* This is the last Beautiful Soup release to officially support Python
  3.7.

* This is also the last release to support the obsolete methods,
  attributes and classes that were deprecated in 4.13.0. In a
  subsequent point release, the DeprecationWarning issued when you use
  these obsolete features will be replaced by NotImplementedError,
  giving you a final chance to change your code before the
  implementations are removed entirely. Once the features are removed,
  code that tries to use them will start behaving strangely, since
  Beautiful Soup will generally interpret the method and attribute
  names as tag names.

* It is now possible to call new_tag() or new_string() directly on an
  existing Tag or NavigableString object, rather than the associated
  BeautifulSoup object. Note that this only works if the object is
  currently inside a parse tree. This means you can't call new_tag()
  or new_string() on an object that (to take the most obvious example)
  was itself created with new_tag() or new_string(). [bug=2102119]

* The type hints for the overloaded find* methods have been redone to
  eliminate type checker overrides. [bug=2122019]

* Explicitly specify the type hint for the PageElement.text property
  [bug=2153390]

* Change the html.parser tree builder's code for handling numeric
  character references, to avoid a crash when using Python versions
  that include the fix to Python issue https://bugs.python.org/issue13633
  (e.g. Python 3.11.13). [bug=2134393]

* Skip the lxml tree builder's test_surrogate_in_character_reference test
  if the libxml2 version is less than 2.13.0. Prior versions of libxml2
  don't issue the REPLACEMENT CHARACTER we're expecting. [bug=2134346]

* When passed a BeautifulSoup object, Tag.append will return a list of
  all elements that were appended, not just the first one. Note that
  this changes the return value type hint for the method, from
  PageElement to PageElement|List[PageElement].

* Fix an unhandled exception in Tag.append when passed an empty
  BeautifulSoup object. [bug=2140924]

* Fix a bug in the html.parser tree builder that triggers if a single
  document includes both the "<br>" version of a void element and
  the "<br/>" version. [bug=2154141]

* No bug was ever filed for this, but it's possible that you could get a
  bizarre return value by passing BeautifulSoup objects into
  Tag.extend(). The return value is now consistently the list of
  elements that were added to the Tag.

* Removed the internal _stacklevel argument to the find* methods, in favor of
  calculating the appropriate stack level in the rare cases where a
  find* method needs to issue a Python warning. Removing an argument makes
  the huge number of overrides more manageable.

* The HTML-related regular expressions and data structures in
  EntitySubstitution are now instantiated lazily when one of them is
  first accessed. This makes initial import a bit faster. [bug=2154394]

Reply all
Reply to author
Forward
0 new messages