public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Karolina Surma <ksurma@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/python-nibabel] rawhide: Fix compatibility with Python 3.15
Date: Wed, 03 Jun 2026 09:53:32 GMT	[thread overview]
Message-ID: <178048041251.1.8658089778781468979.rpms-python-nibabel-c7bd9939e666@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/python-nibabel
Branch : rawhide
Commit : c7bd9939e666b7041895e9c05deacda01e78e936
Author : Karolina Surma <ksurma@redhat.com>
Date   : 2026-05-22T11:39:06+02:00
Stats  : +69/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/python-nibabel/c/c7bd9939e666b7041895e9c05deacda01e78e936?branch=rawhide

Log:
Fix compatibility with Python 3.15

---
diff --git a/1509.patch b/1509.patch
new file mode 100644
index 0000000..88d48d3
--- /dev/null
+++ b/1509.patch
@@ -0,0 +1,60 @@
+From 33c8ff292b8da87da835a88f2dee6a81b0cf088b Mon Sep 17 00:00:00 2001
+From: Karolina Surma <ksurma@redhat.com>
+Date: Fri, 22 May 2026 11:24:36 +0200
+Subject: [PATCH] Set the compression level to match one of the running
+ Python's
+
+---
+ nibabel/_compression.py | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/nibabel/_compression.py b/nibabel/_compression.py
+index 251faae1d..431dca25e 100644
+--- a/nibabel/_compression.py
++++ b/nibabel/_compression.py
+@@ -82,7 +82,7 @@ def __init__(
+         self,
+         filename: str | None = None,
+         mode: Mode | None = None,
+-        compresslevel: int = 9,
++        compresslevel: int | None = None,
+         fileobj: io.FileIO | None = None,
+         mtime: int = 0,
+     ):
+@@ -99,19 +99,23 @@ def __init__(
+                 raise TypeError('Must define either fileobj or filename')
+             # Cast because GzipFile.myfileobj has type io.FileIO while open returns ty.IO
+             fileobj = self.myfileobj = ty.cast('io.FileIO', open(filename, modestr))
++        # Only forward compresslevel when explicitly set; None defers to Python's runtime default
++        compress_kwargs: dict[str, int] = {}
++        if compresslevel is not None:
++            compress_kwargs['compresslevel'] = compresslevel
+         super().__init__(
+             filename='',
+             mode=modestr,
+-            compresslevel=compresslevel,
+             fileobj=fileobj,
+             mtime=mtime,
++            **compress_kwargs,
+         )
+ 
+ 
+ def gzip_open(
+     filename: str,
+     mode: Mode = 'rb',
+-    compresslevel: int = 9,
++    compresslevel: int | None = None,
+     mtime: int = 0,
+     keep_open: bool = False,
+ ) -> gzip.GzipFile:
+@@ -130,8 +134,8 @@ def gzip_open(
+         Path of file to open.
+     mode : str
+         Opening mode - either ``rb`` or ``wb``.
+-    compresslevel: int
+-        Compression level when writing.
++    compresslevel: int | None
++        Compression level when writing. If None, the running Python's default is used.
+     mtime: int
+         Modification time used when writing a file - passed to the
+         ``DetemrinisticGzipFile``. Ignored when reading.

diff --git a/python-nibabel.spec b/python-nibabel.spec
index ceeeded..5dc9027 100644
--- a/python-nibabel.spec
+++ b/python-nibabel.spec
@@ -25,6 +25,15 @@ License:        MIT and PDDL-1.0
 URL:            http://nipy.org/nibabel/
 Source0:        %forgesource
 
+# fix: Set the compression level to match one of the running Python's
+# Proposed upstream: https://github.com/nipy/nibabel/pull/1509
+#
+# Fixes:
+#
+# compatibility with Python 3.15
+# https://github.com/nipy/nibabel/issues/1477
+Patch:          https://github.com/nipy/nibabel/pull/1509.patch
+
 BuildArch:      noarch
 
 %description %_description

                 reply	other threads:[~2026-06-03  9:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178048041251.1.8658089778781468979.rpms-python-nibabel-c7bd9939e666@fedoraproject.org \
    --to=ksurma@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox