Bug 2347496 - ipython needs update to >=8.29.0 to be able to print regex in Py3.13
Summary: ipython needs update to >=8.29.0 to be able to print regex in Py3.13
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ipython
Version: 41
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/ipython/ipython/pu...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-02-25 10:00 UTC by Alicia Boya García
Modified: 2025-02-27 01:59 UTC (History)
7 users (show)

Fixed In Version: ipython-8.26.0-3.fc41
Clone Of:
Environment:
Last Closed: 2025-02-27 01:59:00 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Alicia Boya García 2025-02-25 10:00:12 UTC
re.TEMPLATE was removed in Python 3.13: https://github.com/python/cpython/issues/92728

Unfortunately, IPython only stopped relying on it very recently: commit f7a09f5f5fe52740825acf5a72a427922eb48dbe (Oct 24 2024).

The oldest IPython version with the fix is 8.29.0, but Fedora is shipping 8.26.0.

The bug causes an exception to be thrown when the IPython repr() of a regular expression is generated.

pip install ipython==8.29.0 works around this issue.

Reproducible: Always

Steps to Reproduce:
1. Launch ipython.
2. import re
3. re.compile('foo')
Actual Results:  
File /usr/lib/python3.13/site-packages/IPython/lib/pretty.py:729, in _ReFlags._repr_pretty_(self, p, cycle)
    726 done_one = False
    727 for flag in ('TEMPLATE', 'IGNORECASE', 'LOCALE', 'MULTILINE', 'DOTALL',
    728     'UNICODE', 'VERBOSE', 'DEBUG'):
--> 729     if self.value & getattr(re, flag):
    730         if done_one:
    731             p.text('|')

AttributeError: module 're' has no attribute 'TEMPLATE'

Expected Results:  
Out[2]: re.compile(r'foo', re.UNICODE)

Comment 1 Miro Hrončok 2025-02-25 10:25:54 UTC
I can reproduce this.

Comment 2 Fedora Update System 2025-02-25 12:00:28 UTC
FEDORA-2025-dc0074871f (ipython-8.26.0-3.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-dc0074871f

Comment 3 Fedora Update System 2025-02-26 02:34:03 UTC
FEDORA-2025-dc0074871f has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-dc0074871f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-dc0074871f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2025-02-27 01:59:00 UTC
FEDORA-2025-dc0074871f (ipython-8.26.0-3.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.