Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-flake8 for openSUSE:Factory checked in at 2024-08-22 18:10:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-flake8 (Old) and /work/SRC/openSUSE:Factory/.python-flake8.new.2698 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-flake8" Thu Aug 22 18:10:35 2024 rev:46 rq:1195178 version:7.1.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-flake8/python-flake8.changes 2024-06-17 19:28:21.207749459 +0200 +++ /work/SRC/openSUSE:Factory/.python-flake8.new.2698/python-flake8.changes 2024-08-22 18:10:47.795488134 +0200 @@ -1,0 +2,7 @@ +Wed Aug 21 17:52:22 UTC 2024 - Dirk Müller <[email protected]> + +- update to 7.1.1: + * Properly preserve escaped `{` and `}` in fstrings in logical + lines in 3.12+. + +------------------------------------------------------------------- Old: ---- flake8-7.1.0.tar.gz New: ---- flake8-7.1.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-flake8.spec ++++++ --- /var/tmp/diff_new_pack.CC0YjR/_old 2024-08-22 18:10:48.295508901 +0200 +++ /var/tmp/diff_new_pack.CC0YjR/_new 2024-08-22 18:10:48.295508901 +0200 @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-flake8 -Version: 7.1.0 +Version: 7.1.1 Release: 0 Summary: Modular source code checker: pep8, pyflakes and co License: MIT ++++++ flake8-7.1.0.tar.gz -> flake8-7.1.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.0/docs/source/plugin-development/registering-plugins.rst new/flake8-7.1.1/docs/source/plugin-development/registering-plugins.rst --- old/flake8-7.1.0/docs/source/plugin-development/registering-plugins.rst 2024-06-15 23:36:14.000000000 +0200 +++ new/flake8-7.1.1/docs/source/plugin-development/registering-plugins.rst 2024-08-04 22:31:56.000000000 +0200 @@ -18,7 +18,6 @@ metadata. Let's presume that we already have our plugin written and it's in a module -:external+packaging:term:`Build Backend`, but be aware that most backends called ``flake8_example``. We will also assume ``setuptools`` is used as a :external+packaging:term:`Build Backend`, but be aware that most backends support entry points. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.0/docs/source/release-notes/7.1.1.rst new/flake8-7.1.1/docs/source/release-notes/7.1.1.rst --- old/flake8-7.1.0/docs/source/release-notes/7.1.1.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/flake8-7.1.1/docs/source/release-notes/7.1.1.rst 2024-08-04 22:31:56.000000000 +0200 @@ -0,0 +1,15 @@ +7.1.1 -- 2024-08-04 +------------------- + +You can view the `7.1.1 milestone`_ on GitHub for more details. + +Bugs Fixed +~~~~~~~~~~ + +- Properly preserve escaped `{` and `}` in fstrings in logical lines in 3.12+. + (See also :issue:`1948`, :pull:`1949`). + + +.. all links +.. _7.1.1 milestone: + https://github.com/PyCQA/flake8/milestone/51 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.0/docs/source/release-notes/index.rst new/flake8-7.1.1/docs/source/release-notes/index.rst --- old/flake8-7.1.0/docs/source/release-notes/index.rst 2024-06-15 23:36:14.000000000 +0200 +++ new/flake8-7.1.1/docs/source/release-notes/index.rst 2024-08-04 22:31:56.000000000 +0200 @@ -11,6 +11,7 @@ .. toctree:: 7.0.0 7.1.0 + 7.1.1 6.x Release Series ================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.0/src/flake8/__init__.py new/flake8-7.1.1/src/flake8/__init__.py --- old/flake8-7.1.0/src/flake8/__init__.py 2024-06-15 23:36:14.000000000 +0200 +++ new/flake8-7.1.1/src/flake8/__init__.py 2024-08-04 22:31:56.000000000 +0200 @@ -17,7 +17,7 @@ LOG = logging.getLogger(__name__) LOG.addHandler(logging.NullHandler()) -__version__ = "7.1.0" +__version__ = "7.1.1" __version_info__ = tuple(int(i) for i in __version__.split(".") if i.isdigit()) _VERBOSITY_TO_LOG_LEVEL = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.0/src/flake8/processor.py new/flake8-7.1.1/src/flake8/processor.py --- old/flake8-7.1.0/src/flake8/processor.py 2024-06-15 23:36:14.000000000 +0200 +++ new/flake8-7.1.1/src/flake8/processor.py 2024-08-04 22:31:56.000000000 +0200 @@ -203,7 +203,13 @@ if token_type == tokenize.STRING: text = mutate_string(text) elif token_type == FSTRING_MIDDLE: # pragma: >=3.12 cover - text = "x" * len(text) + # A curly brace in an FSTRING_MIDDLE token must be an escaped + # curly brace. Both 'text' and 'end' will account for the + # escaped version of the token (i.e. a single brace) rather + # than the raw double brace version, so we must counteract this + brace_offset = text.count("{") + text.count("}") + text = "x" * (len(text) + brace_offset) + end = (end[0], end[1] + brace_offset) if previous_row: (start_row, start_column) = start if previous_row != start_row: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-7.1.0/tests/integration/test_plugins.py new/flake8-7.1.1/tests/integration/test_plugins.py --- old/flake8-7.1.0/tests/integration/test_plugins.py 2024-06-15 23:36:14.000000000 +0200 +++ new/flake8-7.1.1/tests/integration/test_plugins.py 2024-08-04 22:31:56.000000000 +0200 @@ -1,6 +1,8 @@ """Integration tests for plugin loading.""" from __future__ import annotations +import sys + import pytest from flake8.main.cli import main @@ -261,3 +263,36 @@ """ out, err = capsys.readouterr() assert out == expected + + +def test_escaping_of_fstrings_in_string_redacter(tmpdir, capsys): + cfg_s = f"""\ +[flake8] +extend-ignore = F +[flake8:local-plugins] +extension = + T = {yields_logical_line.__module__}:{yields_logical_line.__name__} +""" + + cfg = tmpdir.join("tox.ini") + cfg.write(cfg_s) + + src = """\ +f'{{"{hello}": "{world}"}}' +""" + t_py = tmpdir.join("t.py") + t_py.write_binary(src.encode()) + + with tmpdir.as_cwd(): + assert main(("t.py", "--config", str(cfg))) == 1 + + if sys.version_info >= (3, 12): # pragma: >=3.12 cover + expected = """\ +t.py:1:1: T001 "f'xxx{hello}xxxx{world}xxx'" +""" + else: # pragma: <3.12 cover + expected = """\ +t.py:1:1: T001 "f'xxxxxxxxxxxxxxxxxxxxxxxx'" +""" + out, err = capsys.readouterr() + assert out == expected
