acf4a24269
- update to 4.14.3 * When using one of the lxml tree builders, you can pass in huge_tree=True to disable lxml's security restrictions and process files that include huge text nodes. ("huge" means more than 10,000,000 bytes of text in a single node). Without this, lxml may silently stop processing the file after encountering a huge text node. * The html.parser tree builder processes numeric character entities using the algorithm described in the HTML spec. If this means replacing some other character with REPLACEMENT CHARACTER, it will set BeautifulSoup.contains_replacement_characters. * Added a general test of the html.parser tree builder's ability to turn any parsing exception from html.parser into a ParserRejectedMarkup exception. This makes it possible to remove version-dependent tests that depended on the existence of specific bugs in html.parser. - Add htmlparser.patch to fix behaviour with cpython interpreters
Markéta Machová2025-12-29 10:07:43 +00:00
9851dc5e98
- update to 4.14.2: * Making ResultSet inherit from MutableSequence still resulted in too many breaking changes in users of the library, so I reverted the ResultSet code back to where it was in 4.13.5 and added tests of all known breaking behavior. [bug=2125906] * Made ResultSet inherit from MutableSequence instead of Sequence, since lots of existing code treats ResultSet as a mutable list. * This version adds function overloading to the find_* methods to make it easier to write type-safe Python. * The typing for find_parent() and find_parents() was improved without any overloading. Casts should never be necessary, since those methods only ever return Tag and ResultSet[Tag], respectively. * ResultSet now inherits from Sequence. This should make it easier to incorporate ResultSet objects into your type system without needing to handle ResultSet specially. * Fixed an unhandled exception when creating the string representation of a decomposed element. * The default value for the 'attrs' attribute in find* methods is now None, not the empty dictionary. This should have no visible effect on anything. this release through its long beta process.
Dirk Mueller2025-10-13 09:12:53 +00:00
ee642d2d2b
Accepting request 1303567 from devel:languages:python
Ana Guerrero2025-09-11 12:38:08 +00:00
28f35ad36c
- Update to 4.13.5 * Fixed an unhandled exception when parsing invalid markup that contains the { character when using lxml==6.0.0. [bug=2116306] * Fixed a regression when matching a multi-valued attribute against the empty string. [bug=2115352] * Unit tests and test case data are no longer packaged with the wheel. [bug=2107495] * Fixed a bug that gave the wrong result when parsing the empty bytestring. [bug=2110492] * Brought the Spanish translation of the documentation up to date with 4.13.4. Courtesy of Carlos Romero. * For Python 3.13 and above, disabled tests that verify Beautiful Soup's handling of htmlparser's exceptions when given very bad markup. The bug in htmlparser that caused this behavior has been fixed. Patch courtesy of Stefano Rivera. * Used overloading to improve type hints for prettify(). * Updated the SoupStrainer documentation to clarify that during initial parsing, attribute values are always passed into the SoupStrainer as raw strings. [bug=2111651] * Fixed all type checking errors issued by pyright. (Previously only mypy was used for type checking.) * Improved the type hints for PageElement.replace_with. [bug=2114746] * Improved the type hint for the arguments of the lambda function that can be used to match a tag's attribute. [bug=2110401] * Modified some of the lxml tests to accommodate behavioral changes in libxml2 2.14.3. Specifically: 1. XML declarations and processing instructions in HTML documents are rewritten as comments. Note that this means XHTML documents will now turn into regular HTML documents if run through the 'lxml' parser. The 'xml' parser is unaffected. 2. Out-of-range numeric entities are replaced with REPLACEMENT CHARACTER rather than omitted entirely. [bug=2112242]
Dirk Mueller2025-09-10 09:11:16 +00:00
1333d09e56
Accepting request 1293080 from devel:languages:python
Ana Guerrero2025-07-15 14:43:04 +00:00
b4f8e272ce
- Update to 4.13.4 * If you pass a function as the first argument to a find* method, the function will only ever be called once per tag, with the Tag object as the argument. Starting in 4.13.0, there were cases where the function would be called with a Tag object and then called again with the name of the tag. [bug=2106435] * Added a passthrough implementation for NavigableString.__getitem__ which gives a more helpful exception if the user tries to treat it as a Tag and access its HTML attributes. * Fixed a bug that caused an exception when unpickling the result of parsing certain invalid markup with lxml as the tree builder. [bug=2103126] * Converted the AUTHORS file to UTF-8 for PEP8 compliance. [bug=2107405] - Release 4.13.3 (20250204) * Modified the 4.13.2 change slightly to restore backwards compatibility. Specifically, calling a find_* method with no arguments should return the first Tag out of the iterator, not the first PageElement. [bug=2097333] - Release 4.13.2 (20250204) * Gave ElementFilter the ability to explicitly say that it excludes every item in the parse tree. This is used internally in situations where the provided filters are logically inconsistent or match a value against the null set.
Markéta Machová2025-07-14 09:20:38 +00:00
e0fde13fec
- Skip failing test test_rejected_input, it is known to be flaky and dependent on the various changes in Python (which there will be more coming in few days).
Matej Cepl2025-06-18 07:07:05 +00:00
89dfc2f1db
Accepting request 1220019 from devel:languages:python
Ana Guerrero2024-11-06 15:49:29 +00:00
9b0a4c4b8c
- Add soupsieve26-compat.patch to make tests more tolerant with various versions of soupsieve (better solution for lp#2086199).
Matej Cepl2024-11-01 07:23:51 +00:00
1c3cfc65ef
- Skip the test test_unsupported_pseudoclass (lp#2086199).
Matej Cepl2024-10-31 14:24:28 +00:00
55c51aaf4a
Accepting request 1140116 from devel:languages:python
Ana Guerrero2024-01-21 22:07:12 +00:00
1611f8c551
- update to 4.12.3: * Fixed a regression such that if you set .hidden on a tag, the tag becomes invisible but its contents are still visible. User manipulation of .hidden is not a documented or supported feature, so don't do this, but it wasn't too difficult to keep the old behavior working. * Fixed a case found by Mengyuhan where html.parser giving up on markup would result in an AssertionError instead of a ParserRejectedMarkup exception. * Added the correct stacklevel to instances of the XMLParsedAsHTMLWarning. * Corrected the syntax of the license definition in pyproject.toml. * Corrected a typo in a test that was causing test failures when run against libxml2 2.12.1. - Require cchardet explicitly to avoid charset-normalizer braindamage. - disable tests on SLE_11, fail due to too old python-lxml - remove lxml support (fails unit test) - Use recommended lxml parser instead of native one
Dirk Mueller2024-01-20 13:12:27 +00:00
30a5816851
- Update to 4.12.2: * Fixed an unhandled exception in BeautifulSoup.decode_contents and methods that call it. [bug=2015545] - 4.12.1: * This version of Beautiful Soup replaces setup.py and setup.cfg with pyproject.toml. Beautiful Soup now uses tox as its test backend and hatch to do builds. * The main functional improvement in this version is a nonrecursive technique for regenerating a tree. This technique is used to avoid situations where, in previous versions, doing something to a very deeply nested tree would overflow the Python interpreter stack: 1. Outputting a tree as a string, e.g. with BeautifulSoup.encode() [bug=1471755] 2. Making copies of trees (copy.copy() and copy.deepcopy() from the Python standard library). [bug=1709837] 3. Pickling a BeautifulSoup object. (Note that pickling a Tag object can still cause an overflow.) * Making a copy of a BeautifulSoup object no longer parses the document again, which should improve performance significantly. * When a BeautifulSoup object is unpickled, Beautiful Soup now tries to associate an appropriate TreeBuilder object with it. * Tag.prettify() will now consistently end prettified markup with a newline. * Added unit tests for fuzz test cases created by third parties. Some of these tests are skipped since they point to problems outside of Beautiful Soup, but this change puts them all in one convenient place. * PageElement now implements the known_xml attribute. (This was technically a bug, but it shouldn't be an issue in normal use.) [bug=2007895] * The demonstrate_parser_differences.py script was still written in
Daniel Garcia2023-05-08 11:44:27 +00:00
884ed4c8e0
- Update to 4.10.0: * This is the first release of Beautiful Soup to only support Python 3. * The behavior of methods like .get_text() and .strings now differs depending on the type of tag. * NavigableString and its subclasses now implement the get_text() method, as well as the properties .strings and .stripped_strings. * The 'html5' formatter now treats attributes whose values are the empty string as HTML boolean attributes. * The 'replace_with()' method now takes a variable number of arguments, and can be used to replace a single element with a sequence of elements. * Corrected output when the namespace prefix associated with a namespaced attribute is the empty string, as opposed to None. * Performance improvement when processing tags that speeds up overall tree construction by 2%. Patch by Morotti. [bug=1899358] * Corrected the use of special string container classes in cases when a single tag may contain strings with different containers; such as the <template> tag, which may contain both TemplateString objects and Comment objects. * The html.parser tree builder can now handle named entities found in the HTML5 spec in much the same way that the html5lib tree builder does. * Added a second way to pass specify encodings to UnicodeDammit and EncodingDetector, based on the order of precedence defined in the HTML5 spec. * Improve the warning issued when a directory name (as opposed to the name of a regular file) is passed as markup into the BeautifulSoup constructor. - Do not pass the directory to pytest.
Steve Kowalik2022-02-09 10:19:16 +00:00
0ee353a80f
Accepting request 840885 from home:apersaud:branches:devel:languages:python
Tomáš Chvátal
2020-10-12 06:55:28 +00:00
387bfaf83c
- update to 4.9.2: * Fixed a bug that caused too many tags to be popped from the tag stack during tree building, when encountering a closing tag that had no matching opening tag. [bug=1880420] * Fixed a bug that inconsistently moved elements over when passing a Tag, rather than a list, into Tag.extend(). [bug=1885710] * Specify the soupsieve dependency in a way that complies with PEP 508. Patch by Mike Nerone. [bug=1893696] * Change the signatures for BeautifulSoup.insert_before and insert_after (which are not implemented) to match PageElement.insert_before and insert_after, quieting warnings in some IDEs. [bug=1897120]
Dirk Mueller2020-09-28 11:41:50 +00:00
3ce5ed1908
- update to 4.9.1: * Added a keyword argument 'on_duplicate_attribute' to the BeautifulSoupHTMLParser constructor (used by the html.parser tree builder) which lets you customize the handling of markup that contains the same attribute more than once, as in: <a href="url1" href="url2"> [bug=1878209] * Added a distinct subclass, GuessedAtParserWarning, for the warning issued when BeautifulSoup is instantiated without a parser being specified. [bug=1873787] * Added a distinct subclass, MarkupResemblesLocatorWarning, for the warning issued when BeautifulSoup is instantiated with 'markup' that actually seems to be a URL or the path to a file on disk. [bug=1873787] * The new NavigableString subclasses (Stylesheet, Script, and TemplateString) can now be imported directly from the bs4 package. * If you encode a document with a Python-specific encoding like 'unicode_escape', that encoding is no longer mentioned in the final XML or HTML document. Instead, encoding information is omitted or left blank. [bug=1874955] * Fixed test failures when run against soupselect 2.0. Patch by Tomáš Chvátal. [bug=1872279] - remove soupsieve2-tests.patch: upstreamed
Dirk Mueller2020-06-03 11:11:22 +00:00
fa95f50136
- Add patch to fix the tests to pass with new soupsieve too: * soupsieve2-tests.patch * The assert name changed
Tomáš Chvátal
2020-04-12 08:32:03 +00:00
952fbe9438
- Update to 4.8.1: * When the html.parser or html5lib parsers are in use, Beautiful Soup will, by default, record the position in the original document where each tag was encountered. * Fixed the definition of the default XML namespace when using lxml 4.4. * Avoid a crash when unpickling certain parse trees generated using html5lib on Python 3. * Avoid a crash when trying to detect the declared encoding of a Unicode document. - Drop patch beautifulsoup4-lxml-fixes.patch as it seems not needed
Tomáš Chvátal
2019-11-01 09:03:11 +00:00
7b384a9de6
- Replace %fdupes -s with plain %fdupes; hardlinks are better.
Matej Cepl2019-10-14 11:42:36 +00:00
77ec295bda
- Do not generate doc for py2 and py3 variant they are the same so keep just one around - Update to 4.7.1: * Fixed a significant performance problem introduced in 4.7.0. [bug=1810617] * Fixed an incorrectly raised exception when inserting a tag before or after an identical tag. [bug=1810692] * Beautiful Soup will no longer try to keep track of namespaces that are not defined with a prefix; this can confuse soupselect. [bug=1810680] * Tried even harder to avoid the deprecation warning originally fixed in 4.6.1. [bug=1778909] * Beautiful Soup's CSS Selector implementation has been replaced by a dependency on Isaac Muse's SoupSieve project (the soupsieve package on PyPI). The good news is that SoupSieve has a much more robust and complete implementation of CSS selectors, resolving a large number of longstanding issues. The bad news is that from this point onward, SoupSieve must be installed if you want to use the select() method. * Added the PageElement.extend() method, which works like list.append(). [bug=1514970] * PageElement.insert_before() and insert_after() now take a variable number of arguments. [bug=1514970] * Fix a number of problems with the tree builder that caused trees that were superficially okay, but which fell apart when bits were extracted. Patch by Isaac Muse. [bug=1782928,1809910] * Fixed a problem with the tree builder in which elements that contained no content (such as empty comments and all-whitespace elements) were not being treated as part of the tree. Patch by Isaac Muse. [bug=1798699] * Fixed a problem with multi-valued attributes where the value contained whitespace. Thanks to Jens Svalgaard for the fix. [bug=1787453]
Tomáš Chvátal
2019-03-01 11:53:37 +00:00
7787148ca5
- update to 4.6.0: * Added the Tag.get_attribute_list method, which acts like Tag.get for getting the value of an attribute, but which always returns a list, whether or not the attribute is a multi-value attribute. [bug=1678589] * Improved the handling of empty-element tags like <br> when using the html.parser parser. [bug=1676935] * HTML parsers treat all HTML4 and HTML5 empty element tags (aka void element tags) correctly. [bug=1656909] * Namespace prefix is preserved when an XML tag is copied. Thanks to Vikas for a patch and test. [bug=1685172]
Dirk Mueller2017-07-05 06:30:11 +00:00