public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/Cython] rawhide: Update to 3.3.1 (rhbz#2564599)
@ 2026-11-12 11:29 Lumir Balhar
  0 siblings, 0 replies; only message in thread
From: Lumir Balhar @ 2026-11-12 11:29 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/Cython
Branch : rawhide
Commit : 9578d401efe9090acc9b0aa3bb7dc430837ee7c1
Author : Lumir Balhar <lbalhar@redhat.com>
Date   : 2026-11-10T10:44:51+01:00
Stats  : +37/-110 in 4 file(s)
URL    : https://src.fedoraproject.org/rpms/Cython/c/9578d401efe9090acc9b0aa3bb7dc430837ee7c1?branch=rawhide

Log:
Update to 3.3.1 (rhbz#2564599)

---
diff --git a/8128.patch b/8128.patch
new file mode 100644
index 0000000..c76c8c9
--- /dev/null
+++ b/8128.patch
@@ -0,0 +1,33 @@
+From a166768b2ce8520c231ec584cd6d5623daf22d48 Mon Sep 17 00:00:00 2001
+From: Lumir Balhar <lbalhar@redhat.com>
+Date: Tue, 10 Nov 2026 10:41:02 +0100
+Subject: [PATCH] Reset echo_file in close_listing_file() to avoid writing to a
+ closed stderr
+
+open_listing_file() stores sys.stderr in the thread-local
+cython_errors_echo_file, but close_listing_file() only cleared the
+listing file, leaving the stderr reference dangling. A later warning()
+(e.g. the c_string_encoding notice from detect_opened_file_encoding)
+could then write to a stderr the caller had already closed or
+redirected, raising "ValueError: I/O operation on closed file". This
+surfaced as an intermittent failure of
+TestCythonUtils.test_detect_file_encoding under the parallel test
+harness. Clear echo_file on close so it no longer outlives the compile.
+---
+ Cython/Compiler/Errors.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/Cython/Compiler/Errors.py b/Cython/Compiler/Errors.py
+index d95d6e4391b..ff22792c8f6 100644
+--- a/Cython/Compiler/Errors.py
++++ b/Cython/Compiler/Errors.py
+@@ -156,6 +156,9 @@ def close_listing_file():
+     if threadlocal.cython_errors_listing_file:
+         threadlocal.cython_errors_listing_file.close()
+         threadlocal.cython_errors_listing_file = None
++    # Drop the stderr reference too, so a later warning() cannot write to a
++    # stderr that the caller has since closed or redirected.
++    threadlocal.cython_errors_echo_file = None
+ 
+ def report_error(err, use_stack=True):
+     error_stack = threadlocal.cython_errors_stack

diff --git a/Cython.spec b/Cython.spec
index 4d6ef0d..752ee5b 100644
--- a/Cython.spec
+++ b/Cython.spec
@@ -5,7 +5,7 @@
 %bcond cython_compile 1
 
 Name:           Cython
-Version:        3.2.8
+Version:        3.3.1
 Release:        %autorelease
 Summary:        Language for writing Python extension modules
 
@@ -13,9 +13,8 @@ License:        Apache-2.0
 URL:            http://www.cython.org
 Source:         https://github.com/cython/cython/archive/%{version}/Cython-%{version}.tar.gz
 
-# Fix issues with the ipython tests
-# Resolved upstream: https://github.com/cython/cython/pull/7553
-Patch:          fix-ipython-tests.patch
+# Reset echo_file in close_listing_file() to avoid writing to a closed stderr
+Patch:          https://github.com/cython/cython/pull/8128.patch
 
 BuildRequires:  python3-devel
 

diff --git a/fix-ipython-tests.patch b/fix-ipython-tests.patch
deleted file mode 100644
index 39c5370..0000000
--- a/fix-ipython-tests.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From cc7eba1894beae94288a963b76ce89d7c1eff1a7 Mon Sep 17 00:00:00 2001
-From: scoder <stefan_ml@behnel.de>
-Date: Fri, 6 Mar 2026 23:15:05 +0100
-Subject: [PATCH] Tests: Clean up builtins after running IPython tests
- (GH-7553)
-
-If useful in more places, most of this can be moved into CythonTest.
-
-Closes https://github.com/cython/cython/issues/7075
-Supersedes https://github.com/cython/cython/pull/7078
----
- Cython/Build/Tests/TestIpythonMagic.py | 54 +++++++++++++++++---------
- 1 file changed, 35 insertions(+), 19 deletions(-)
-
-diff --git a/Cython/Build/Tests/TestIpythonMagic.py b/Cython/Build/Tests/TestIpythonMagic.py
-index 86f5c1a059b..7036ef10f83 100644
---- a/Cython/Build/Tests/TestIpythonMagic.py
-+++ b/Cython/Build/Tests/TestIpythonMagic.py
-@@ -3,36 +3,21 @@
- """Tests for the Cython magics extension."""
- 
- 
-+import builtins
- import os
- import io
- import sys
- from contextlib import contextmanager
--from unittest import skipIf
-+from unittest import skipIf, SkipTest
- 
- from Cython.Build import IpythonMagic
- from Cython.TestUtils import CythonTest
- from Cython.Compiler.Annotate import AnnotationCCodeWriter
- 
--try:
--    import IPython.testing.globalipapp
--except ImportError:
--    # Disable tests and fake helpers for initialisation below.
--    def skip_if_not_installed(_):
--        return None
--else:
--    def skip_if_not_installed(c):
--        return c
- 
- # not using IPython's decorators here because they depend on "nose"
- skip_win32 = skipIf(sys.platform == 'win32', "Skip on Windows")
- 
--try:
--    # disable IPython history thread before it gets started to avoid having to clean it up
--    from IPython.core.history import HistoryManager
--    HistoryManager.enabled = False
--except ImportError:
--    pass
--
- 
- @contextmanager
- def capture_output():
-@@ -94,14 +79,45 @@ def doit():
- '''
- 
- 
--@skip_if_not_installed
- class TestIPythonMagic(CythonTest):
-+    _orig_builtins = None
- 
-     @classmethod
-     def setUpClass(cls):
--        CythonTest.setUpClass()
-+        super().setUpClass()
-+
-+        # IPython modifies the builtins, so keep a clean copy before the import.
-+        orig_builtins = dict(builtins.__dict__)
-+
-+        try:
-+            import IPython.testing.globalipapp
-+        except ImportError as exc:
-+            # Disable tests and fake helpers for initialisation below.
-+            raise SkipTest(f"IPython is not installed: {exc}")
-+
-+        try:
-+            # disable IPython history thread before it gets started to avoid having to clean it up
-+            from IPython.core.history import HistoryManager
-+            HistoryManager.enabled = False
-+        except ImportError:
-+            pass
-+
-+        cls._orig_builtins = orig_builtins
-         cls._ip = IPython.testing.globalipapp.get_ipython()
- 
-+    @classmethod
-+    def tearDownClass(cls):
-+        # Clean up builtins from IPython left-overs.
-+        if cls._orig_builtins:
-+            for name in list(vars(builtins)):
-+                if name not in cls._orig_builtins:
-+                    delattr(builtins, name)
-+            for name, value in cls._orig_builtins.items():
-+                if getattr(builtins, name, None) is not value:
-+                    setattr(builtins, name, value)
-+
-+        super().tearDownClass()
-+
-     def setUp(self):
-         CythonTest.setUp(self)
-         self._ip.extension_manager.load_extension('cython')

diff --git a/sources b/sources
index 5e11b72..4b46fb6 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (Cython-3.2.8.tar.gz) = 75712af94c8c3129bc06df84db2c8cac92ecba28950811a52366dcb95c0cd53847079824d16493d1cd97b910beaf4c0226513650e04e76e93178d9ebd40cd915
+SHA512 (Cython-3.3.1.tar.gz) = d7f766b42bae70bd6d78c808c4f900dbb15fca854751f2ece8a03011819e3fc7eb033dfd6744c88fa62f64a18cefcb1d3d5854581850bfaf332804e66549d94e

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-12 11:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 11:29 [rpms/Cython] rawhide: Update to 3.3.1 (rhbz#2564599) Lumir Balhar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox