Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-qrcode for openSUSE:Factory 
checked in at 2024-06-13 15:40:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-qrcode (Old)
 and      /work/SRC/openSUSE:Factory/.python-qrcode.new.19518 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-qrcode"

Thu Jun 13 15:40:14 2024 rev:12 rq:1180322 version:7.4.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-qrcode/python-qrcode.changes      
2024-02-05 22:01:35.515862194 +0100
+++ /work/SRC/openSUSE:Factory/.python-qrcode.new.19518/python-qrcode.changes   
2024-06-13 15:40:28.671359605 +0200
@@ -1,0 +2,6 @@
+Wed Jun 12 12:06:29 UTC 2024 - John Paul Adrian Glaubitz 
<[email protected]>
+
+- Cherry-pick upstream patch to fix build with GCC 14
+  * https://github.com/lincolnloop/python-qrcode/pull/364.patch
+
+-------------------------------------------------------------------

New:
----
  364.patch

BETA DEBUG BEGIN:
  New:- Cherry-pick upstream patch to fix build with GCC 14
  * https://github.com/lincolnloop/python-qrcode/pull/364.patch
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-qrcode.spec ++++++
--- /var/tmp/diff_new_pack.ITZNIw/_old  2024-06-13 15:40:29.423387074 +0200
+++ /var/tmp/diff_new_pack.ITZNIw/_new  2024-06-13 15:40:29.423387074 +0200
@@ -24,6 +24,8 @@
 License:        BSD-3-Clause
 URL:            https://github.com/lincolnloop/python-qrcode
 Source:         
https://files.pythonhosted.org/packages/source/q/qrcode/qrcode-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM - Add buffer and fileno for mocked sys.stdout
+Patch:          https://github.com/lincolnloop/python-qrcode/pull/364.patch
 BuildRequires:  %{python_module Pillow}
 BuildRequires:  %{python_module pip}
 BuildRequires:  %{python_module pypng}
@@ -48,6 +50,7 @@
 
 %prep
 %setup -q -n qrcode-%{version}
+%patch -P0 -p1
 # drop shebang from console_scripts
 sed -i '1s@^#!.*@@' qrcode/console_scripts.py
 

++++++ 364.patch ++++++
>From 0fd5649d6f971e5c19ac7f6953e9d6737d3fbb0b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Van=C4=9Bk?= <[email protected]>
Date: Mon, 10 Jun 2024 13:22:24 +0200
Subject: [PATCH] Add buffer and fileno for mocked sys.stdout

This change fixes the issue of two failing tests because the sys.stdout
seems not to be properly mocked. Both tests need a buffer and test_piped
additionally needs fileno method.
---
 qrcode/tests/test_script.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/qrcode/tests/test_script.py b/qrcode/tests/test_script.py
index 4ae4ccbc..96458e4c 100644
--- a/qrcode/tests/test_script.py
+++ b/qrcode/tests/test_script.py
@@ -30,6 +30,8 @@ def test_isatty(self, mock_print_ascii):
     @mock.patch("sys.stdout")
     @unittest.skipIf(not Image, "Requires PIL")
     def test_piped(self, mock_stdout):
+        mock_stdout.buffer = io.BytesIO()
+        mock_stdout.fileno = lambda: 999
         main(["testtext"])
 
     @mock.patch("os.isatty", lambda *args: True)
@@ -61,6 +63,7 @@ def test_optimize(self, mock_print_ascii):
 
     @mock.patch("sys.stdout")
     def test_factory(self, mock_stdout):
+        mock_stdout.buffer = io.BytesIO()
         main("testtext --factory svg".split())
 
     @mock.patch("sys.stderr")

Reply via email to