public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/python-pexpect] rawhide: Suppress DeprecationWarning for os.forkpty() on Python 3.15+
Date: Mon, 22 Jun 2026 13:44:55 GMT	[thread overview]
Message-ID: <178213589586.1.15757807289766527098.rpms-python-pexpect-bc24b6e1f418@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/python-pexpect
Branch : rawhide
Commit : bc24b6e1f4186ed83e6a58857d68e39897a36548
Author : Tomáš Hrnčiar <thrnciar@redhat.com>
Date   : 2026-06-22T10:48:58+02:00
Stats  : +50/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/python-pexpect/c/bc24b6e1f4186ed83e6a58857d68e39897a36548?branch=rawhide

Log:
Suppress DeprecationWarning for os.forkpty() on Python 3.15+

---
diff --git a/827.patch b/827.patch
new file mode 100644
index 0000000..eb1f75e
--- /dev/null
+++ b/827.patch
@@ -0,0 +1,42 @@
+From 36fc8ac7f89be0557912685f3fd4e6e6d1b2afbd Mon Sep 17 00:00:00 2001
+From: Tomas Hrnciar <thrnciar@redhat.com>
+Date: Mon, 22 Jun 2026 09:51:56 +0200
+Subject: [PATCH] Suppress DeprecationWarning for os.forkpty() on Python 3.15+
+
+CPython 3.15 emits a DeprecationWarning when os.forkpty() (or
+os.fork()) is called in a multi-threaded process.
+
+See: https://github.com/pexpect/pexpect/issues/827
+---
+ pexpect/pty_spawn.py | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/pexpect/pty_spawn.py b/pexpect/pty_spawn.py
+index 8e28ca7..fafa677 100644
+--- a/pexpect/pty_spawn.py
++++ b/pexpect/pty_spawn.py
+@@ -5,6 +5,7 @@ import pty
+ import tty
+ import errno
+ import signal
++import warnings
+ from contextlib import contextmanager
+ 
+ import ptyprocess
+@@ -312,7 +313,12 @@ class spawn(SpawnBase):
+ 
+     def _spawnpty(self, args, **kwargs):
+         '''Spawn a pty and return an instance of PtyProcess.'''
+-        return ptyprocess.PtyProcess.spawn(args, **kwargs)
++        with warnings.catch_warnings():
++            warnings.filterwarnings(
++                'ignore', category=DeprecationWarning,
++                message=r'.*multi-threaded.*use of fork.*',
++            )
++            return ptyprocess.PtyProcess.spawn(args, **kwargs)
+ 
+     def close(self, force=True):
+         '''This closes the connection with the child application. Note that
+-- 
+2.54.0
+

diff --git a/python-pexpect.spec b/python-pexpect.spec
index 94dea11..2d46bee 100644
--- a/python-pexpect.spec
+++ b/python-pexpect.spec
@@ -5,7 +5,7 @@
 Name:           python-%{modname}
 Summary:        Unicode-aware Pure Python Expect-like module
 Version:        4.9.0
-Release:        17%{?dist}
+Release:        18%{?dist}
 
 # All the files have ISC license except the
 # following two that have BSD license:
@@ -19,6 +19,9 @@ Source0:        %{url}/archive/%{version}/%{modname}-%{version}.tar.gz
 Patch:          https://github.com/pexpect/pexpect/pull/794.patch
 # Tests: Avoid the multiprocessing forkserver method (for Python 3.14+ compatibility)
 Patch:          https://github.com/pexpect/pexpect/pull/808.patch
+# Suppress DeprecationWarning for os.forkpty() on Python 3.15+ (gh#827)
+# Upstream issue: https://github.com/pexpect/pexpect/issues/827
+Patch:          827.patch
 
 BuildRequires:  /usr/bin/man
 %if %{with check}
@@ -107,6 +110,10 @@ ignore="${ignore-} --ignore=tests/test_performance.py"
 %{python3_sitelib}/%{modname}-*.dist-info
 
 %changelog
+* Mon Jun 22 2026 Tomáš Hrnčiar <thrnciar@redhat.com> - 4.9.0-18
+- Suppress DeprecationWarning for os.forkpty() on Python 3.15+
+- Fixes: rhbz#2458644
+
 * Fri Jun 12 2026 Yaakov Selkowitz <yselkowi@redhat.com> - 4.9.0-17
 - Rebuilt for openssl 4.0
 

                 reply	other threads:[~2026-06-22 13:44 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=178213589586.1.15757807289766527098.rpms-python-pexpect-bc24b6e1f418@fedoraproject.org \
    --to=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