Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-loguru for openSUSE:Factory checked in at 2022-08-10 17:12:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-loguru (Old) and /work/SRC/openSUSE:Factory/.python-loguru.new.1521 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-loguru" Wed Aug 10 17:12:22 2022 rev:8 rq:993322 version:0.6.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-loguru/python-loguru.changes 2021-12-12 21:27:09.660325602 +0100 +++ /work/SRC/openSUSE:Factory/.python-loguru.new.1521/python-loguru.changes 2022-08-10 17:12:24.357567978 +0200 @@ -1,0 +2,25 @@ +Fri Aug 5 11:11:57 UTC 2022 - Ben Greiner <[email protected]> + +- Update to 0.6.0 + * Remove internal use of pickle.loads() considered as a security + vulnerability referenced as CVE-2022-0329 (#563). + * Modify coroutine sink to make it discard log messages when + loop=None and no event loop is running (due to internally using + asyncio.get_running_loop() in place of + asyncio.get_event_loop()). + * Remove the possibility to add a coroutine sink with + enqueue=True if loop=None and no event loop is running. + * Change default encoding of file sink to be utf8 instead of + locale.getpreferredencoding() (#339). + * Prevent non-ascii characters to be escaped while logging JSON + message with serialize=True (#575, thanks @ponponon). + * Fix flake8 errors and improve code readability (#353, thanks + @AndrewYakimets). +- Drop merged patches: + * loguru-exception-formatting-py39.patch + * pytest-6.2-excepthooks.patch +- Add loguru-fix-repr-tests.patch + * Fix "repr()" tests failing on Python 3.11 and Python 3.10.6 + * https://github.com/Delgan/loguru/commit/4fe21f66 + +------------------------------------------------------------------- Old: ---- loguru-0.5.3.tar.gz loguru-exception-formatting-py39.patch pytest-6.2-excepthooks.patch New: ---- loguru-0.6.0.tar.gz loguru-fix-repr-tests.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-loguru.spec ++++++ --- /var/tmp/diff_new_pack.tuN8z2/_old 2022-08-10 17:12:25.993572248 +0200 +++ /var/tmp/diff_new_pack.tuN8z2/_new 2022-08-10 17:12:25.997572258 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-loguru # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,17 +19,15 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-loguru -Version: 0.5.3 +Version: 0.6.0 Release: 0 Summary: Python logging component with a simple interface License: MIT Group: Development/Languages/Python URL: https://github.com/Delgan/loguru Source: https://files.pythonhosted.org/packages/source/l/loguru/loguru-%{version}.tar.gz -# PATCH-FIX-UPSTREAM pytest-6.2-excepthooks.patch -Patch0: https://github.com/Delgan/loguru/commit/31cf758ee9d22dbfa125f38153782fe20ac9dce5.patch#/pytest-6.2-excepthooks.patch -# PATCH-FIX-UPSTREAM loguru-exception-formatting-py39.patch -Patch1: https://github.com/Delgan/loguru/commit/19f518c5f1f355703ffc4ee62f0e1e397605863e.patch#/loguru-exception-formatting-py39.patch +# PATCH-FIX-UPSTREAM loguru-fix-repr-tests.patch https://github.com/Delgan/loguru/commit/4fe21f6 -- Fix "repr()" tests failing on Python 3.11 and Python 3.10.6 +Patch1: loguru-fix-repr-tests.patch BuildRequires: %{python_module aiocontextvars if %python-base < 3.7} BuildRequires: %{python_module colorama} BuildRequires: %{python_module pytest} @@ -64,9 +62,7 @@ # Threads have different references on 32-bit donttest=" or (test_log_formatters and thread and not thread.name)" fi -# different line numbers -- https://github.com/Delgan/loguru/issues/550 -python310_donttest=" or (test_exceptions_formatting and formatting_with_context_manager)" -%pytest -k "not (donttestexprprefixdummy $donttest ${$python_donttest})" +%pytest -k "not (donttestexprprefixdummy $donttest)" %files %{python_files} %license LICENSE ++++++ loguru-0.5.3.tar.gz -> loguru-0.6.0.tar.gz ++++++ ++++ 8210 lines of diff (skipped) ++++++ loguru-fix-repr-tests.patch ++++++ >From 4fe21f66991abeb1905e24c3bc3c634543d959a2 Mon Sep 17 00:00:00 2001 From: Delgan <[email protected]> Date: Sun, 17 Jul 2022 09:18:56 +0200 Subject: [PATCH] Fix "repr()" tests failing on Python 3.11 --- tests/test_repr.py | 87 +++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 51 deletions(-) diff --git a/tests/test_repr.py b/tests/test_repr.py index ba48839..76f413d 100644 --- a/tests/test_repr.py +++ b/tests/test_repr.py @@ -1,34 +1,11 @@ -import builtins import logging import pathlib import re import sys -from inspect import iscoroutinefunction -import loguru from loguru import logger -class Wrapper: - def __init__(self, wrapped, *, repr, name): - self._wrapped = wrapped - self._repr = repr - self._name = name - self.raised = False - - def __repr__(self): - return self._repr - - def __getattr__(self, name): - if name == "__name__": - if self._name is None: - self.raised = True - raise AttributeError - else: - return self._name - return getattr(self._wrapped, name) - - def test_no_handler(): assert repr(logger) == "<loguru.logger handlers=[]>" @@ -112,22 +89,30 @@ def my_function(message): assert repr(logger) == "<loguru.logger handlers=[(id=0, level=10, sink=my_function)]>" -def test_function_without_name(monkeypatch): - function = Wrapper(lambda _: None, repr="<FunctionWithout>", name=None) - monkeypatch.setattr(builtins, "callable", lambda x: x is function or callable(x)) +def test_callable_without_name(): + class Function: + def __call__(self): + pass + + def __repr__(self): + return "<FunctionWithout>" - logger.add(function) + logger.add(Function()) assert repr(logger) == "<loguru.logger handlers=[(id=0, level=10, sink=<FunctionWithout>)]>" - assert function.raised -def test_function_with_empty_name(monkeypatch): - function = Wrapper(lambda _: None, repr="<FunctionEmpty>", name="") - monkeypatch.setattr(builtins, "callable", lambda x: x is function or callable(x)) +def test_callable_with_empty_name(): + class Function: + __name__ = "" + + def __call__(self): + pass + + def __repr__(self): + return "<FunctionEmpty>" - logger.add(function) + logger.add(Function()) assert repr(logger) == "<loguru.logger handlers=[(id=0, level=10, sink=<FunctionEmpty>)]>" - assert not function.raised def test_coroutine_function(): @@ -138,32 +123,32 @@ async def my_async_function(message): assert repr(logger) == "<loguru.logger handlers=[(id=0, level=10, sink=my_async_function)]>" -def test_coroutine_function_without_name(monkeypatch): - async_function = Wrapper(lambda _: None, repr="<AsyncFunctionWithout>", name=None) - monkeypatch.setattr( - loguru._logger, - "iscoroutinefunction", - lambda x: x is async_function or iscoroutinefunction(x), - ) +def test_coroutine_callable_without_name(): + class CoroutineFunction: + async def __call__(self): + pass + + def __repr__(self): + return "<AsyncFunctionWithout>" - logger.add(async_function) + logger.add(CoroutineFunction()) assert ( repr(logger) == "<loguru.logger handlers=[(id=0, level=10, sink=<AsyncFunctionWithout>)]>" ) - assert async_function.raised -def test_coroutine_function_with_empty_name(monkeypatch): - async_function = Wrapper(lambda _: None, repr="<AsyncFunctionEmpty>", name="") - monkeypatch.setattr( - loguru._logger, - "iscoroutinefunction", - lambda x: x is async_function or iscoroutinefunction(x), - ) +def test_coroutine_function_with_empty_name(): + class CoroutineFunction: + __name__ = "" + + def __call__(self): + pass + + def __repr__(self): + return "<AsyncFunctionEmpty>" - logger.add(async_function) + logger.add(CoroutineFunction()) assert repr(logger) == "<loguru.logger handlers=[(id=0, level=10, sink=<AsyncFunctionEmpty>)]>" - assert not async_function.raised def test_standard_handler():
