Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-MarkupSafe for openSUSE:Factory checked in at 2024-01-29 22:25:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-MarkupSafe (Old) and /work/SRC/openSUSE:Factory/.python-MarkupSafe.new.1815 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-MarkupSafe" Mon Jan 29 22:25:56 2024 rev:29 rq:1141812 version:2.1.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-MarkupSafe/python-MarkupSafe.changes 2023-06-21 22:37:08.937392540 +0200 +++ /work/SRC/openSUSE:Factory/.python-MarkupSafe.new.1815/python-MarkupSafe.changes 2024-01-29 22:25:59.786878357 +0100 @@ -1,0 +2,7 @@ +Fri Jan 26 21:18:09 UTC 2024 - Dirk Müller <dmuel...@suse.com> + +- update to 2.1.4: + * Don't use regular expressions for striptags, avoiding a + performance issue. :pr:`413` + +------------------------------------------------------------------- Old: ---- MarkupSafe-2.1.3.tar.gz New: ---- MarkupSafe-2.1.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-MarkupSafe.spec ++++++ --- /var/tmp/diff_new_pack.eAtyqR/_old 2024-01-29 22:26:00.446902280 +0100 +++ /var/tmp/diff_new_pack.eAtyqR/_new 2024-01-29 22:26:00.450902425 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-MarkupSafe # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %bcond_without test %{?sle15_python_module_pythons} Name: python-MarkupSafe -Version: 2.1.3 +Version: 2.1.4 Release: 0 Summary: Implements a XML/HTML/XHTML Markup safe string for Python License: BSD-3-Clause ++++++ MarkupSafe-2.1.3.tar.gz -> MarkupSafe-2.1.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MarkupSafe-2.1.3/CHANGES.rst new/MarkupSafe-2.1.4/CHANGES.rst --- old/MarkupSafe-2.1.3/CHANGES.rst 2023-06-02 23:13:16.000000000 +0200 +++ new/MarkupSafe-2.1.4/CHANGES.rst 2024-01-19 23:23:07.000000000 +0100 @@ -1,3 +1,12 @@ +Version 2.1.4 +------------- + +Released 2024-01-19 + +- Don't use regular expressions for ``striptags``, avoiding a performance + issue. :pr:`413` + + Version 2.1.3 ------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MarkupSafe-2.1.3/PKG-INFO new/MarkupSafe-2.1.4/PKG-INFO --- old/MarkupSafe-2.1.3/PKG-INFO 2023-06-02 23:13:25.750226700 +0200 +++ new/MarkupSafe-2.1.4/PKG-INFO 2024-01-19 23:23:15.583197400 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: MarkupSafe -Version: 2.1.3 +Version: 2.1.4 Summary: Safely add untrusted strings to HTML/XML markup. Home-page: https://palletsprojects.com/p/markupsafe/ Maintainer: Pallets diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MarkupSafe-2.1.3/requirements/dev.txt new/MarkupSafe-2.1.4/requirements/dev.txt --- old/MarkupSafe-2.1.3/requirements/dev.txt 2023-06-02 23:13:16.000000000 +0200 +++ new/MarkupSafe-2.1.4/requirements/dev.txt 2024-01-19 23:23:07.000000000 +0100 @@ -24,7 +24,7 @@ # via tox distlib==0.3.6 # via virtualenv -filelock==3.12.0 +filelock==3.12.2 # via # tox # virtualenv @@ -36,13 +36,13 @@ # via -r requirements/dev.in pip-tools==6.13.0 # via pip-compile-multi -platformdirs==3.5.1 +platformdirs==3.8.0 # via # tox # virtualenv -pre-commit==3.3.2 +pre-commit==3.3.3 # via -r requirements/dev.in -pyproject-api==1.5.1 +pyproject-api==1.5.2 # via tox pyproject-hooks==1.0.0 # via build @@ -50,9 +50,9 @@ # via pre-commit toposort==1.10 # via pip-compile-multi -tox==4.5.2 +tox==4.6.3 # via -r requirements/dev.in -virtualenv==20.23.0 +virtualenv==20.23.1 # via # pre-commit # tox diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MarkupSafe-2.1.3/requirements/docs.txt new/MarkupSafe-2.1.4/requirements/docs.txt --- old/MarkupSafe-2.1.3/requirements/docs.txt 2023-06-02 23:13:16.000000000 +0200 +++ new/MarkupSafe-2.1.4/requirements/docs.txt 2024-01-19 23:23:07.000000000 +0100 @@ -21,13 +21,13 @@ # via sphinx jinja2==3.1.2 # via sphinx -markupsafe==2.1.2 +markupsafe==2.1.3 # via jinja2 packaging==23.1 # via # pallets-sphinx-themes # sphinx -pallets-sphinx-themes==2.1.0 +pallets-sphinx-themes==2.1.1 # via -r requirements/docs.in pygments==2.15.1 # via sphinx @@ -57,5 +57,5 @@ # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -urllib3==2.0.2 +urllib3==2.0.3 # via requests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MarkupSafe-2.1.3/requirements/tests.txt new/MarkupSafe-2.1.4/requirements/tests.txt --- old/MarkupSafe-2.1.3/requirements/tests.txt 2023-06-02 23:13:16.000000000 +0200 +++ new/MarkupSafe-2.1.4/requirements/tests.txt 2024-01-19 23:23:07.000000000 +0100 @@ -9,7 +9,7 @@ # via pytest packaging==23.1 # via pytest -pluggy==1.0.0 +pluggy==1.2.0 # via pytest -pytest==7.3.1 +pytest==7.4.0 # via -r requirements/tests.in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MarkupSafe-2.1.3/requirements/typing.txt new/MarkupSafe-2.1.4/requirements/typing.txt --- old/MarkupSafe-2.1.3/requirements/typing.txt 2023-06-02 23:13:16.000000000 +0200 +++ new/MarkupSafe-2.1.4/requirements/typing.txt 2024-01-19 23:23:07.000000000 +0100 @@ -5,9 +5,9 @@ # # pip-compile-multi # -mypy==1.3.0 +mypy==1.4.1 # via -r requirements/typing.in mypy-extensions==1.0.0 # via mypy -typing-extensions==4.6.2 +typing-extensions==4.6.3 # via mypy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MarkupSafe-2.1.3/setup.cfg new/MarkupSafe-2.1.4/setup.cfg --- old/MarkupSafe-2.1.3/setup.cfg 2023-06-02 23:13:25.754227200 +0200 +++ new/MarkupSafe-2.1.4/setup.cfg 2024-01-19 23:23:15.583197400 +0100 @@ -39,7 +39,6 @@ testpaths = tests filterwarnings = error - ignore:ast:DeprecationWarning [coverage:run] branch = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MarkupSafe-2.1.3/src/MarkupSafe.egg-info/PKG-INFO new/MarkupSafe-2.1.4/src/MarkupSafe.egg-info/PKG-INFO --- old/MarkupSafe-2.1.3/src/MarkupSafe.egg-info/PKG-INFO 2023-06-02 23:13:25.000000000 +0200 +++ new/MarkupSafe-2.1.4/src/MarkupSafe.egg-info/PKG-INFO 2024-01-19 23:23:15.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: MarkupSafe -Version: 2.1.3 +Version: 2.1.4 Summary: Safely add untrusted strings to HTML/XML markup. Home-page: https://palletsprojects.com/p/markupsafe/ Maintainer: Pallets diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MarkupSafe-2.1.3/src/markupsafe/__init__.py new/MarkupSafe-2.1.4/src/markupsafe/__init__.py --- old/MarkupSafe-2.1.3/src/markupsafe/__init__.py 2023-06-02 23:13:16.000000000 +0200 +++ new/MarkupSafe-2.1.4/src/markupsafe/__init__.py 2024-01-19 23:23:07.000000000 +0100 @@ -1,5 +1,4 @@ import functools -import re import string import sys import typing as t @@ -14,10 +13,7 @@ _P = te.ParamSpec("_P") -__version__ = "2.1.3" - -_strip_comments_re = re.compile(r"<!--.*?-->", re.DOTALL) -_strip_tags_re = re.compile(r"<.*?>", re.DOTALL) +__version__ = "2.1.4" def _simple_escaping_wrapper(func: "t.Callable[_P, str]") -> "t.Callable[_P, Markup]": @@ -162,10 +158,41 @@ >>> Markup("Main »\t<em>About</em>").striptags() 'Main » About' """ - # Use two regexes to avoid ambiguous matches. - value = _strip_comments_re.sub("", self) - value = _strip_tags_re.sub("", value) - value = " ".join(value.split()) + # collapse spaces + value = " ".join(self.split()) + + # Look for comments then tags separately. Otherwise, a comment that + # contains a tag would end early, leaving some of the comment behind. + + while True: + # keep finding comment start marks + start = value.find("<!--") + + if start == -1: + break + + # find a comment end mark beyond the start, otherwise stop + end = value.find("-->", start) + + if end == -1: + break + + value = f"{value[:start]}{value[end + 3:]}" + + # remove tags using the same method + while True: + start = value.find("<") + + if start == -1: + break + + end = value.find(">", start) + + if end == -1: + break + + value = f"{value[:start]}{value[end + 1:]}" + return self.__class__(value).unescape() @classmethod diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MarkupSafe-2.1.3/tox.ini new/MarkupSafe-2.1.4/tox.ini --- old/MarkupSafe-2.1.3/tox.ini 2023-06-02 23:13:16.000000000 +0200 +++ new/MarkupSafe-2.1.4/tox.ini 2024-01-19 23:23:07.000000000 +0100 @@ -1,7 +1,7 @@ [tox] envlist = - py3{12,11,10,9,8,7} - pypy39 + py3{12,11,10,9,8} + pypy310 style typing docs @@ -18,11 +18,9 @@ commands = pre-commit run --all-files [testenv:typing] -package = wheel deps = -r requirements/typing.txt commands = mypy [testenv:docs] -package = wheel deps = -r requirements/docs.txt commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html