Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-tinyhtml5 for
openSUSE:Factory checked in at 2026-03-25 21:20:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-tinyhtml5 (Old)
and /work/SRC/openSUSE:Factory/.python-tinyhtml5.new.8177 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-tinyhtml5"
Wed Mar 25 21:20:04 2026 rev:2 rq:1342403 version:2.1.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-tinyhtml5/python-tinyhtml5.changes
2024-11-06 16:52:52.850375724 +0100
+++
/work/SRC/openSUSE:Factory/.python-tinyhtml5.new.8177/python-tinyhtml5.changes
2026-03-27 06:49:16.785409310 +0100
@@ -1,0 +2,8 @@
+Wed Mar 25 08:42:50 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 2.1.0:
+ * Support Python 3.14.
+ * Drop support of Python 3.9.
+ * Allow useless parameters for all HTML input streams.
+
+-------------------------------------------------------------------
Old:
----
tinyhtml5-2.0.0.tar.gz
New:
----
tinyhtml5-2.1.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-tinyhtml5.spec ++++++
--- /var/tmp/diff_new_pack.BKJP2i/_old 2026-03-27 06:49:17.429435830 +0100
+++ /var/tmp/diff_new_pack.BKJP2i/_new 2026-03-27 06:49:17.433435995 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-tinyhtml5
#
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2026 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -15,17 +15,18 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
+
%{?sle15_python_module_pythons}
Name: python-tinyhtml5
-Version: 2.0.0
+Version: 2.1.0
Release: 0
Summary: HTML parser based on the WHATWG HTML specification
License: MIT
URL: None
Source:
https://files.pythonhosted.org/packages/source/t/tinyhtml5/tinyhtml5-%{version}.tar.gz
-BuildRequires: python-rpm-macros
BuildRequires: %{python_module flit-core >= 3.2}
BuildRequires: %{python_module pip}
+BuildRequires: python-rpm-macros
# SECTION test requirements
BuildRequires: %{python_module webencodings >= 0.5.1}
BuildRequires: %{python_module pytest}
@@ -62,7 +63,6 @@
license, without any additional terms or conditions. For full authorship
information, see the version control history.
-
%prep
%autosetup -p1 -n tinyhtml5-%{version}
++++++ tinyhtml5-2.0.0.tar.gz -> tinyhtml5-2.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tinyhtml5-2.0.0/PKG-INFO new/tinyhtml5-2.1.0/PKG-INFO
--- old/tinyhtml5-2.0.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
+++ new/tinyhtml5-2.1.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
@@ -1,11 +1,11 @@
-Metadata-Version: 2.1
+Metadata-Version: 2.4
Name: tinyhtml5
-Version: 2.0.0
+Version: 2.1.0
Summary: HTML parser based on the WHATWG HTML specification
Keywords: html,parser
Author-email: James Graham <[email protected]>
Maintainer-email: CourtBouillon <[email protected]>
-Requires-Python: >=3.9
+Requires-Python: >=3.10
Description-Content-Type: text/x-rst
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
@@ -14,15 +14,16 @@
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
-Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
+Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Markup :: HTML
+License-File: LICENSE
Requires-Dist: webencodings >=0.5.1
Requires-Dist: sphinx ; extra == "doc"
Requires-Dist: sphinx_rtd_theme ; extra == "doc"
@@ -46,7 +47,7 @@
Graham, Sam Sneddon, Łukasz Langa and Will Kahn-Greene.
* Free software: MIT license
-* For Python 3.9+, tested on CPython and PyPy
+* For Python 3.10+, tested on CPython and PyPy
* Documentation: https://doc.courtbouillon.org/tinyhtml5
* Changelog: https://github.com/CourtBouillon/tinyhtml5/releases
* Code, issues, tests: https://github.com/CourtBouillon/tinyhtml5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tinyhtml5-2.0.0/README.rst
new/tinyhtml5-2.1.0/README.rst
--- old/tinyhtml5-2.0.0/README.rst 2024-09-18 17:34:15.011374500 +0200
+++ new/tinyhtml5-2.1.0/README.rst 2026-03-05 18:02:33.327235000 +0100
@@ -7,7 +7,7 @@
Graham, Sam Sneddon, Łukasz Langa and Will Kahn-Greene.
* Free software: MIT license
-* For Python 3.9+, tested on CPython and PyPy
+* For Python 3.10+, tested on CPython and PyPy
* Documentation: https://doc.courtbouillon.org/tinyhtml5
* Changelog: https://github.com/CourtBouillon/tinyhtml5/releases
* Code, issues, tests: https://github.com/CourtBouillon/tinyhtml5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tinyhtml5-2.0.0/docs/changelog.rst
new/tinyhtml5-2.1.0/docs/changelog.rst
--- old/tinyhtml5-2.0.0/docs/changelog.rst 2024-10-29 16:20:30.680494800
+0100
+++ new/tinyhtml5-2.1.0/docs/changelog.rst 2026-03-05 18:02:33.327235000
+0100
@@ -4,6 +4,20 @@
tinyhtml5 changelog
-------------------
+2.1.0
+~~~~~
+
+Released on 2026-03-05.
+
+Dependencies:
+
+* Support Python 3.14.
+* Drop support of Python 3.9.
+
+Features:
+
+* Allow useless parameters for all HTML input streams.
+
2.0.0
~~~~~
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tinyhtml5-2.0.0/docs/conf.py
new/tinyhtml5-2.1.0/docs/conf.py
--- old/tinyhtml5-2.0.0/docs/conf.py 2024-09-18 13:23:42.205299900 +0200
+++ new/tinyhtml5-2.1.0/docs/conf.py 2026-03-05 18:02:33.328235100 +0100
@@ -5,20 +5,20 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
- 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx',
'sphinx.ext.autosectionlabel']
+ "sphinx.ext.autodoc", "sphinx.ext.intersphinx",
"sphinx.ext.autosectionlabel"]
# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
+templates_path = ["_templates"]
# The suffix of source filenames.
-source_suffix = '.rst'
+source_suffix = ".rst"
# The master toctree document.
-master_doc = 'index'
+master_doc = "index"
# General information about the project.
-project = 'tinyhtml5'
-copyright = 'James Graham, Sam Sneddon and contributors'
+project = "tinyhtml5"
+copyright = "James Graham, Sam Sneddon and contributors"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -28,25 +28,25 @@
release = tinyhtml5.__version__
# The short X.Y version.
-version = '.'.join(release.split('.')[:2])
+version = ".".join(release.split(".")[:2])
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
-exclude_patterns = ['_build']
+exclude_patterns = ["_build"]
# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'monokai'
+pygments_style = "monokai"
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
-html_theme = 'sphinx_rtd_theme'
+html_theme = "sphinx_rtd_theme"
html_theme_options = {
- 'collapse_navigation': False,
+ "collapse_navigation": False,
}
# Favicon URL
-html_favicon = 'https://www.courtbouillon.org/static/images/favicon.png'
+html_favicon = "https://www.courtbouillon.org/static/images/favicon.png"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
@@ -56,30 +56,30 @@
# These paths are either relative to html_static_path
# or fully qualified paths (eg. https://...)
html_css_files = [
- 'https://www.courtbouillon.org/static/docs.css',
+ "https://www.courtbouillon.org/static/docs.css",
]
# Output file base name for HTML help builder.
-htmlhelp_basename = 'tinyhtml5doc'
+htmlhelp_basename = "tinyhtml5doc"
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('index', 'tinyhtml5', 'tinyhtml5 Documentation',
- ['James Graham, Sam Sneddon and contributors'], 1)
+ ("index", "tinyhtml5", "tinyhtml5 Documentation",
+ ["James Graham, Sam Sneddon and contributors"], 1)
]
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- ('index', 'tinyhtml5', 'tinyhtml5 Documentation',
- 'James Graham, Sam Sneddon and contributors', 'tinyhtml5',
- 'A tiny HTML5 parser', 'Miscellaneous'),
+ ("index", "tinyhtml5", "tinyhtml5 Documentation",
+ "James Graham, Sam Sneddon and contributors", "tinyhtml5",
+ "A tiny HTML5 parser", "Miscellaneous"),
]
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
- 'python': ('https://docs.python.org/3', None),
- 'webencodings': ('https://pythonhosted.org/webencodings', None),
+ "python": ("https://docs.python.org/3", None),
+ "webencodings": ("https://pythonhosted.org/webencodings", None),
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tinyhtml5-2.0.0/pyproject.toml
new/tinyhtml5-2.1.0/pyproject.toml
--- old/tinyhtml5-2.0.0/pyproject.toml 2024-10-29 11:32:43.728024000 +0100
+++ new/tinyhtml5-2.1.0/pyproject.toml 2026-03-05 18:02:33.328235100 +0100
@@ -8,7 +8,7 @@
keywords = ['html', 'parser']
authors = [{name = 'James Graham', email = '[email protected]'}]
maintainers = [{name = 'CourtBouillon', email = '[email protected]'}]
-requires-python = '>=3.9'
+requires-python = '>=3.10'
readme = {file = 'README.rst', content-type = 'text/x-rst'}
license = {file = 'LICENSE'}
dependencies = [
@@ -22,11 +22,11 @@
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
- 'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
+ 'Programming Language :: Python :: 3.14',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules',
@@ -58,5 +58,5 @@
omit = ['.*']
[tool.ruff.lint]
-select = ['E', 'W', 'F', 'I', 'N', 'RUF']
+select = ['E', 'W', 'F', 'I', 'N', 'RUF', 'T20', 'PIE', 'PT', 'RSE', 'UP', 'Q']
ignore = ['RUF001', 'RUF002', 'RUF003']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tinyhtml5-2.0.0/tests/test_encoding.py
new/tinyhtml5-2.1.0/tests/test_encoding.py
--- old/tinyhtml5-2.0.0/tests/test_encoding.py 2024-07-28 23:59:27.653354200
+0200
+++ new/tinyhtml5-2.1.0/tests/test_encoding.py 2026-03-05 18:02:33.328235100
+0100
@@ -13,7 +13,7 @@
for i, test in enumerate(Data(path, b"data", encoding=None)))
[email protected]("id, test", _tests, ids=(id for id, _ in _tests))
[email protected](("id", "test"), _tests, ids=(id for id, _ in _tests))
def test_parser_encoding(id, test):
parser = HTMLParser()
assert parser.encoding is None
@@ -26,7 +26,7 @@
assert encoding == parser.encoding, error_message
[email protected]("id, test", _tests, ids=(id for id, _ in _tests))
[email protected](("id", "test"), _tests, ids=(id for id, _ in _tests))
def test_prescan_encoding(id, test):
stream = HTMLBinaryInputStream(test[b"data"])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tinyhtml5-2.0.0/tests/test_tokenizer.py
new/tinyhtml5-2.1.0/tests/test_tokenizer.py
--- old/tinyhtml5-2.0.0/tests/test_tokenizer.py 2024-07-29 09:26:23.647704000
+0200
+++ new/tinyhtml5-2.1.0/tests/test_tokenizer.py 2026-03-05 18:02:33.328235100
+0100
@@ -85,8 +85,8 @@
"""
check_self_closing = any(
- token[0] == "StartTag" and len(token) == 4 or
- token[0] == "EndTag" and len(token) == 3
+ (token[0] == "StartTag" and len(token) == 4) or
+ (token[0] == "EndTag" and len(token) == 3)
for token in expected)
if not check_self_closing:
for token in received:
@@ -136,7 +136,7 @@
)
[email protected]("id, test", _tests, ids=(id for id, _ in _tests))
[email protected](("id", "test"), _tests, ids=(id for id, _ in _tests))
def test_tokenizer(id, test):
if "initialStates" not in test:
test["initialStates"] = ["Data state"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tinyhtml5-2.0.0/tests/test_tree_construction.py
new/tinyhtml5-2.1.0/tests/test_tree_construction.py
--- old/tinyhtml5-2.0.0/tests/test_tree_construction.py 2024-07-29
00:17:26.052142600 +0200
+++ new/tinyhtml5-2.1.0/tests/test_tree_construction.py 2026-03-05
18:02:33.329235000 +0100
@@ -118,8 +118,8 @@
"plain-text-unsafe-0",
)
[email protected]("namespace", (False, True), ids=("nons", "ns"))
[email protected]("id, test", _tests, ids=(id for id, _ in _tests))
[email protected]("namespace", [False, True], ids=("nons", "ns"))
[email protected](("id", "test"), _tests, ids=(id for id, _ in _tests))
def test_tree_construction(id, test, namespace):
# TODO: Check error messages.
parser = HTMLParser(namespace_html_elements=namespace)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tinyhtml5-2.0.0/tinyhtml5/__init__.py
new/tinyhtml5-2.1.0/tinyhtml5/__init__.py
--- old/tinyhtml5-2.0.0/tinyhtml5/__init__.py 2024-10-29 16:20:46.522627000
+0100
+++ new/tinyhtml5-2.1.0/tinyhtml5/__init__.py 2026-03-05 18:02:33.329235000
+0100
@@ -15,4 +15,4 @@
__all__ = ["parse"]
-VERSION = __version__ = "2.0.0"
+VERSION = __version__ = "2.1.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tinyhtml5-2.0.0/tinyhtml5/constants.py
new/tinyhtml5-2.1.0/tinyhtml5/constants.py
--- old/tinyhtml5-2.0.0/tinyhtml5/constants.py 2024-07-29 09:30:07.461106000
+0200
+++ new/tinyhtml5-2.1.0/tinyhtml5/constants.py 2026-03-05 18:02:33.329235000
+0100
@@ -277,16 +277,16 @@
# ^3: param
# https://developer.mozilla.org/en-US/docs/Web/HTML/Element/param
-cdata_elements = frozenset(['title', 'textarea'])
+cdata_elements = frozenset(["title", "textarea"])
rcdata_elements = frozenset([
- 'style',
- 'script',
- 'xmp',
- 'iframe',
- 'noembed',
- 'noframes',
- 'noscript'
+ "style",
+ "script",
+ "xmp",
+ "iframe",
+ "noembed",
+ "noframes",
+ "noscript"
])
replacement_characters = {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tinyhtml5-2.0.0/tinyhtml5/inputstream.py
new/tinyhtml5-2.1.0/tinyhtml5/inputstream.py
--- old/tinyhtml5-2.0.0/tinyhtml5/inputstream.py 2024-07-28
22:58:01.413612800 +0200
+++ new/tinyhtml5-2.1.0/tinyhtml5/inputstream.py 2026-03-05
18:02:33.330235000 +0100
@@ -54,18 +54,13 @@
"""
- def __init__(self, source):
+ def __init__(self, source, **kwargs):
"""Initialise the HTMLInputStream.
Create a normalized stream from source for use by tinyhtml5.
source can be either a file-object, local filename or a string.
- The optional encoding parameter must be a string that indicates
- the encoding. If specified, that encoding will be used,
- regardless of any BOM or later declaration (such as in a meta
- element).
-
"""
# List of where new lines occur.
self.new_lines = [0]
@@ -95,13 +90,13 @@
source can be either a file object, local filename or a string.
"""
- return source if hasattr(source, 'read') else StringIO(source)
+ return source if hasattr(source, "read") else StringIO(source)
def _position(self, offset):
chunk = self.chunk
- number_lines = chunk.count('\n', 0, offset)
+ number_lines = chunk.count("\n", 0, offset)
position_line = self.previous_number_lines + number_lines
- last_line_position = chunk.rfind('\n', 0, offset)
+ last_line_position = chunk.rfind("\n", 0, offset)
if last_line_position == -1:
position_column = self.previous_number_columns + offset
else:
@@ -239,7 +234,7 @@
def __init__(self, source, override_encoding=None, transport_encoding=None,
same_origin_parent_encoding=None, likely_encoding=None,
- default_encoding="windows-1252"):
+ default_encoding="windows-1252", **kwargs):
# Raw Stream - for Unicode objects this will encode to UTF-8 and set
# self.encoding as appropriate.
self.raw_stream = self.open_stream(source)
@@ -264,12 +259,12 @@
def reset(self):
streamreader = self.encoding[0].codec_info.streamreader
- self.stream = streamreader(self.raw_stream, 'replace')
+ self.stream = streamreader(self.raw_stream, "replace")
super().reset()
def open_stream(self, source):
- if hasattr(source, 'read'):
- if hasattr(source, 'seekable') and source.seekable():
+ if hasattr(source, "read"):
+ if hasattr(source, "seekable") and source.seekable():
return source
source = source.read()
return BytesIO(source)
@@ -338,11 +333,11 @@
"""
boms = {
- codecs.BOM_UTF8: 'utf-8',
- codecs.BOM_UTF16_LE: 'utf-16le',
- codecs.BOM_UTF16_BE: 'utf-16be',
- codecs.BOM_UTF32_LE: 'utf-32le',
- codecs.BOM_UTF32_BE: 'utf-32be',
+ codecs.BOM_UTF8: "utf-8",
+ codecs.BOM_UTF16_LE: "utf-16le",
+ codecs.BOM_UTF16_BE: "utf-16be",
+ codecs.BOM_UTF32_LE: "utf-32le",
+ codecs.BOM_UTF32_BE: "utf-32be",
}
# Go to beginning of file and read in 4 bytes.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tinyhtml5-2.0.0/tinyhtml5/parser.py
new/tinyhtml5-2.1.0/tinyhtml5/parser.py
--- old/tinyhtml5-2.0.0/tinyhtml5/parser.py 2024-07-29 09:29:16.430212000
+0200
+++ new/tinyhtml5-2.1.0/tinyhtml5/parser.py 2026-03-05 18:02:33.331235200
+0100
@@ -90,7 +90,7 @@
self.tokenizer.state = self.tokenizer.rcdata_state
elif self.container in rcdata_elements:
self.tokenizer.state = self.tokenizer.rawtext_state
- elif self.container == 'plaintext':
+ elif self.container == "plaintext":
self.tokenizer.state = self.tokenizer.plaintext_state
else:
# State already is data state.
@@ -115,7 +115,7 @@
:obj:`None` if that is not determined yet.
"""
- if hasattr(self, 'tokenizer'):
+ if hasattr(self, "tokenizer"):
return self.tokenizer.stream.encoding[0].name
def is_html_integration_point(self, element):
@@ -295,7 +295,7 @@
class Phase:
"""Base class for helper that implements each phase of processing."""
- __slots__ = ("parser", "tree", "__start_tag_cache", "__end_tag_cache")
+ __slots__ = ("__end_tag_cache", "__start_tag_cache", "parser", "tree")
def __init__(self, parser, tree):
self.parser = parser
@@ -377,7 +377,7 @@
correct = token["correct"]
if (name != "html" or public_id is not None or
- system_id is not None and system_id != "about:legacy-compat"):
+ (system_id is not None and system_id !=
"about:legacy-compat")):
self.parser.parse_error("unknown-doctype")
if public_id is None:
@@ -450,20 +450,20 @@
public_id in ("-//w3o//dtd w3 html strict 3.0//en//",
"-/w3c/dtd html 4.0 transitional/en",
"html") or
- public_id.startswith(
+ (public_id.startswith(
("-//w3c//dtd html 4.01 frameset//",
"-//w3c//dtd html 4.01 transitional//")) and
- system_id is None or
- system_id and system_id.lower() ==
- "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"):
+ system_id is None) or
+ (system_id and system_id.lower() ==
+ "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd")):
self.parser.compatibility_mode = "quirks"
elif (public_id.startswith(
("-//w3c//dtd xhtml 1.0 frameset//",
"-//w3c//dtd xhtml 1.0 transitional//")) or
- public_id.startswith(
+ (public_id.startswith(
("-//w3c//dtd html 4.01 frameset//",
"-//w3c//dtd html 4.01 transitional//")) and
- system_id is not None):
+ system_id is not None)):
self.parser.compatibility_mode = "limited quirks"
self.parser.phase = self.parser.phases["before html"]
@@ -644,7 +644,7 @@
def end_tag_head(self, token):
node = self.parser.tree.open_elements.pop()
- assert node.name == "head", "Expected head got %s" % node.name
+ assert node.name == "head", f"Expected head got {node.name}"
self.parser.phase = self.parser.phases["after head"]
def end_tag_html_body_br(self, token):
@@ -1542,7 +1542,7 @@
return True
def start_tag_other(self, token):
- assert False, ( # pragma: no cover
+ raise ValueError( # pragma: no cover
f"Tried to process start tag {token['name']} in RCDATA/RAWTEXT
mode")
def end_tag_script(self, token):
@@ -1706,7 +1706,7 @@
class InTableTextPhase(Phase):
- __slots__ = ("original_phase", "character_tokens")
+ __slots__ = ("character_tokens", "original_phase")
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@@ -2630,9 +2630,9 @@
def adjust_attributes(token, replacements):
- if token['data'].keys() & replacements.keys():
- token['data'] = type(token['data'])(
- (replacements.get(key, key), value) for key, value in
token['data'].items())
+ if token["data"].keys() & replacements.keys():
+ token["data"] = type(token["data"])(
+ (replacements.get(key, key), value) for key, value in
token["data"].items())
def implied_tag_token(name, type="END_TAG", attributes=None,
self_closing=False):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tinyhtml5-2.0.0/tinyhtml5/tokenizer.py
new/tinyhtml5-2.1.0/tinyhtml5/tokenizer.py
--- old/tinyhtml5-2.0.0/tinyhtml5/tokenizer.py 2024-07-29 09:26:47.824089500
+0200
+++ new/tinyhtml5-2.1.0/tinyhtml5/tokenizer.py 2026-03-05 18:02:33.331235200
+0100
@@ -54,7 +54,7 @@
is requested.
"""
- self.token_queue = deque([])
+ self.token_queue = deque()
# Start processing. When EOF is reached self.state will return False
# instead of True and the loop will terminate.
while self.state():
@@ -949,7 +949,7 @@
data = self.stream.character()
if data in space_characters:
self.stream.chars_until(space_characters, True)
- elif data == "\"":
+ elif data == '"':
self.state = self.attribute_value_double_quoted_state
elif data == "&":
self.state = self.attribute_value_unquoted_state
@@ -977,7 +977,7 @@
def attribute_value_double_quoted_state(self):
data = self.stream.character()
- if data == "\"":
+ if data == '"':
self.state = self.after_attribute_value_state
elif data == "&":
self.process_entity_in_attribute('"')
@@ -989,7 +989,7 @@
self.state = self.data_state
else:
self.current_token["data"][-1][1] += (
- data + self.stream.chars_until(("\"", "&", "\u0000")))
+ data + self.stream.chars_until(('"', "&", "\u0000")))
return True
def attribute_value_single_quoted_state(self):
@@ -1088,9 +1088,9 @@
self.current_token = {"type": Token.COMMENT, "data": ""}
self.state = self.comment_start_state
return True
- elif stack[-1] and stack[-1] in 'dD':
+ elif stack[-1] and stack[-1] in "dD":
matched = True
- for expected in ('oO', 'cC', 'tT', 'yY', 'pP', 'eE'):
+ for expected in ("oO", "cC", "tT", "yY", "pP", "eE"):
stack.append(self.stream.character())
if not stack[-1] or stack[-1] not in expected:
matched = False
@@ -1378,7 +1378,7 @@
data = self.stream.character()
if data in space_characters:
pass
- elif data == "\"":
+ elif data == '"':
self.current_token["publicId"] = ""
self.state = self.doctype_public_identifier_double_quoted_state
elif data == "'":
@@ -1538,7 +1538,7 @@
def doctype_system_identifier_double_quoted_state(self):
data = self.stream.character()
- if data == "\"":
+ if data == '"':
self.state = self.after_doctype_system_identifier_state
elif data == "\u0000":
self.parse_error("invalid-codepoint")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tinyhtml5-2.0.0/tinyhtml5/treebuilder.py
new/tinyhtml5-2.1.0/tinyhtml5/treebuilder.py
--- old/tinyhtml5-2.0.0/tinyhtml5/treebuilder.py 2024-07-28
22:58:01.414613000 +0200
+++ new/tinyhtml5-2.1.0/tinyhtml5/treebuilder.py 2026-03-05
18:02:33.332235000 +0100
@@ -250,7 +250,7 @@
return False
# We should never reach this point.
- assert False # pragma: no cover
+ raise ValueError # pragma: no cover
def reconstruct_active_formatting_elements(self):
# Within this algorithm the order of steps described in the