Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-exceptiongroup for openSUSE:Factory checked in at 2023-03-17 17:02:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-exceptiongroup (Old) and /work/SRC/openSUSE:Factory/.python-exceptiongroup.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-exceptiongroup" Fri Mar 17 17:02:05 2023 rev:4 rq:1071876 version:1.1.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-exceptiongroup/python-exceptiongroup.changes 2023-01-06 17:05:06.836032514 +0100 +++ /work/SRC/openSUSE:Factory/.python-exceptiongroup.new.31432/python-exceptiongroup.changes 2023-03-17 17:02:26.137106118 +0100 @@ -1,0 +2,9 @@ +Tue Mar 14 22:18:18 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 1.1.1: + * Worked around `CPython issue #98778 + ``urllib.error.HTTPError(..., fp=None)`` raises + ``KeyError`` on unknown attribute access, on affected + Python versions. + +------------------------------------------------------------------- Old: ---- exceptiongroup-1.1.0-gh.tar.gz New: ---- exceptiongroup-1.1.1-gh.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-exceptiongroup.spec ++++++ --- /var/tmp/diff_new_pack.OnNRa3/_old 2023-03-17 17:02:26.669108905 +0100 +++ /var/tmp/diff_new_pack.OnNRa3/_new 2023-03-17 17:02:26.673108926 +0100 @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -28,7 +28,7 @@ %endif Name: python-exceptiongroup%{psuffix} -Version: 1.1.0 +Version: 1.1.1 Release: 0 Summary: Backport of PEP 654 (exception groups) License: MIT AND Python-2.0 ++++++ exceptiongroup-1.1.0-gh.tar.gz -> exceptiongroup-1.1.1-gh.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/exceptiongroup-1.1.0/.pre-commit-config.yaml new/exceptiongroup-1.1.1/.pre-commit-config.yaml --- old/exceptiongroup-1.1.0/.pre-commit-config.yaml 2022-12-23 10:04:49.000000000 +0100 +++ new/exceptiongroup-1.1.1/.pre-commit-config.yaml 2023-03-12 22:27:24.000000000 +0100 @@ -16,7 +16,7 @@ - id: trailing-whitespace - repo: https://github.com/pycqa/isort - rev: v5.11.3 + rev: 5.12.0 hooks: - id: isort @@ -27,7 +27,7 @@ args: ["--py37-plus", "--keep-runtime-typing"] - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.1.0 hooks: - id: black exclude: "tests/test_catch_py311.py" @@ -40,7 +40,7 @@ exclude: "tests/test_catch_py311.py" - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 + rev: v1.10.0 hooks: - id: python-check-blanket-noqa - id: python-check-blanket-type-ignore diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/exceptiongroup-1.1.0/CHANGES.rst new/exceptiongroup-1.1.1/CHANGES.rst --- old/exceptiongroup-1.1.0/CHANGES.rst 2022-12-23 10:04:49.000000000 +0100 +++ new/exceptiongroup-1.1.1/CHANGES.rst 2023-03-12 22:27:24.000000000 +0100 @@ -3,6 +3,13 @@ This library adheres to `Semantic Versioning 2.0 <http://semver.org/>`_. +**1.1.1** + +- Worked around + `CPython issue #98778 <https://github.com/python/cpython/issues/98778>`_, + ``urllib.error.HTTPError(..., fp=None)`` raises ``KeyError`` on unknown attribute + access, on affected Python versions. (PR by Zac Hatfield-Dodds) + **1.1.0** - Backported upstream fix for gh-99553 (custom subclasses of ``BaseExceptionGroup`` that diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/exceptiongroup-1.1.0/src/exceptiongroup/_exceptions.py new/exceptiongroup-1.1.1/src/exceptiongroup/_exceptions.py --- old/exceptiongroup-1.1.0/src/exceptiongroup/_exceptions.py 2022-12-23 10:04:49.000000000 +0100 +++ new/exceptiongroup-1.1.1/src/exceptiongroup/_exceptions.py 2023-03-12 22:27:24.000000000 +0100 @@ -171,9 +171,10 @@ __condition: type[_BaseExceptionT] | tuple[type[_BaseExceptionT], ...] | Callable[[_BaseExceptionT_co], bool], - ) -> tuple[BaseExceptionGroup[_BaseExceptionT] | None, Self | None] | tuple[ - Self | None, Self | None - ]: + ) -> ( + tuple[BaseExceptionGroup[_BaseExceptionT] | None, Self | None] + | tuple[Self | None, Self | None] + ): condition = get_condition_filter(__condition) if condition(self): return self, None @@ -274,7 +275,8 @@ __condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...] | Callable[[_ExceptionT_co], bool], - ) -> tuple[ExceptionGroup[_ExceptionT] | None, Self | None] | tuple[ - Self | None, Self | None - ]: + ) -> ( + tuple[ExceptionGroup[_ExceptionT] | None, Self | None] + | tuple[Self | None, Self | None] + ): return super().split(__condition) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/exceptiongroup-1.1.0/src/exceptiongroup/_formatting.py new/exceptiongroup-1.1.1/src/exceptiongroup/_formatting.py --- old/exceptiongroup-1.1.0/src/exceptiongroup/_formatting.py 2022-12-23 10:04:49.000000000 +0100 +++ new/exceptiongroup-1.1.1/src/exceptiongroup/_formatting.py 2023-03-12 22:27:24.000000000 +0100 @@ -103,7 +103,16 @@ # Capture now to permit freeing resources: only complication is in the # unofficial API _format_final_exc_line self._str = _safe_string(exc_value, "exception") - self.__notes__ = getattr(exc_value, "__notes__", None) + try: + self.__notes__ = getattr(exc_value, "__notes__", None) + except KeyError: + # Workaround for https://github.com/python/cpython/issues/98778 on Python + # <= 3.9, and some 3.10 and 3.11 patch versions. + HTTPError = getattr(sys.modules.get("urllib.error", None), "HTTPError", ()) + if sys.version_info[:2] <= (3, 11) and isinstance(exc_value, HTTPError): + self.__notes__ = None + else: + raise if exc_type and issubclass(exc_type, SyntaxError): # Handle SyntaxError's specially diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/exceptiongroup-1.1.0/tests/test_exceptions.py new/exceptiongroup-1.1.1/tests/test_exceptions.py --- old/exceptiongroup-1.1.0/tests/test_exceptions.py 2022-12-23 10:04:49.000000000 +0100 +++ new/exceptiongroup-1.1.1/tests/test_exceptions.py 2023-03-12 22:27:24.000000000 +0100 @@ -451,7 +451,7 @@ eg = create_nested_eg() line0 = create_nested_eg.__code__.co_firstlineno - for (tb, expected) in [ + for tb, expected in [ (eg.__traceback__, line0 + 19), (eg.exceptions[0].__traceback__, line0 + 6), (eg.exceptions[1].__traceback__, line0 + 14), @@ -469,7 +469,7 @@ line0 = create_nested_eg.__code__.co_firstlineno expected_tbs = [[line0 + 19, line0 + 6, line0 + 4], [line0 + 19, line0 + 14]] - for (i, (_, tbs)) in enumerate(leaf_generator(eg)): + for i, (_, tbs) in enumerate(leaf_generator(eg)): self.assertSequenceEqual([tb.tb_lineno for tb in tbs], expected_tbs[i]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/exceptiongroup-1.1.0/tests/test_formatting.py new/exceptiongroup-1.1.1/tests/test_formatting.py --- old/exceptiongroup-1.1.0/tests/test_formatting.py 2022-12-23 10:04:49.000000000 +0100 +++ new/exceptiongroup-1.1.1/tests/test_formatting.py 2023-03-12 22:27:24.000000000 +0100 @@ -1,5 +1,7 @@ import sys +import traceback from typing import NoReturn +from urllib.error import HTTPError import pytest from _pytest.capture import CaptureFixture @@ -528,3 +530,9 @@ print_exception(e) # does not crash output = capsys.readouterr().err assert "NamedAttributeError" in output + + +def test_works_around_httperror_bug(): + # See https://github.com/python/cpython/issues/98778 in Python <= 3.9 + err = HTTPError("url", 405, "METHOD NOT ALLOWED", None, None) + traceback.TracebackException(type(err), err, None)