public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Lumir Balhar <lbalhar@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/ipython] rawhide: Fix compatibility with Python 3.15 beta 1
Date: Wed, 03 Jun 2026 09:55:16 GMT	[thread overview]
Message-ID: <178048051694.1.11236072074863669807.rpms-ipython-74dec535831b@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/ipython
Branch : rawhide
Commit : 74dec535831b954812811f190e05b8d50082ac70
Author : Lumir Balhar <lbalhar@redhat.com>
Date   : 2026-05-22T13:38:15+02:00
Stats  : +49/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/ipython/c/74dec535831b954812811f190e05b8d50082ac70?branch=rawhide

Log:
Fix compatibility with Python 3.15 beta 1

---
diff --git a/15220.patch b/15220.patch
new file mode 100644
index 0000000..df18cb8
--- /dev/null
+++ b/15220.patch
@@ -0,0 +1,45 @@
+From c13a2a6e8cc43a6cb0bd068d0809ee26d65972a2 Mon Sep 17 00:00:00 2001
+From: Lumir Balhar <lbalhar@redhat.com>
+Date: Fri, 22 May 2026 13:35:19 +0200
+Subject: [PATCH] Fix %debug and ipdb with Python 3.15
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Python 3.15 introduced PyREPL as the default pdb input backend
+(via _maybe_use_pyrepl_as_stdin()), which temporarily sets
+use_rawinput=False before calling cmdloop(). IPython's TerminalPdb
+raises ValueError when it sees use_rawinput=False.
+
+Override _cmdloop() in IPython.core.debugger.Pdb to bypass the
+PyREPL wrapping — IPython already has its own input handling via
+prompt_toolkit and doesn't need PyREPL.
+
+Fixes: https://github.com/ipython/ipython/issues/15217
+---
+ IPython/core/debugger.py | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py
+index 4afd86427de..05c839272d9 100644
+--- a/IPython/core/debugger.py
++++ b/IPython/core/debugger.py
+@@ -515,6 +515,18 @@ def do_exceptions(self, arg):
+                 else:
+                     self.error("No exception with that number")
+ 
++    def _cmdloop(self):
++        # Override to bypass Python 3.15's _maybe_use_pyrepl_as_stdin(), which
++        # sets use_rawinput=False and conflicts with IPython's own input handling.
++        while True:
++            try:
++                self.allow_kbdint = True
++                self.cmdloop()
++                self.allow_kbdint = False
++                break
++            except KeyboardInterrupt:
++                self.message("--KeyboardInterrupt--")
++
+     def interaction(self, frame, tb_or_exc):
+         try:
+             if CHAIN_EXCEPTIONS:

diff --git a/ipython.spec b/ipython.spec
index a998207..3412d84 100644
--- a/ipython.spec
+++ b/ipython.spec
@@ -27,6 +27,10 @@ License:        BSD-3-Clause AND MIT
 URL:            http://ipython.org/
 Source0:        %pypi_source
 
+# Fix %%debug and ipdb with Python 3.15 (PyREPL conflicts with IPython's input handling)
+# https://github.com/ipython/ipython/issues/15217
+Patch:          https://github.com/ipython/ipython/pull/15220.patch
+
 # Unset -s on python shebang - ensure that packages installed with pip
 # to user locations are seen and properly loaded.
 %undefine _py3_shebang_s

                 reply	other threads:[~2026-06-03  9:55 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=178048051694.1.11236072074863669807.rpms-ipython-74dec535831b@fedoraproject.org \
    --to=lbalhar@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