Skip to content

Commit e421c55

Browse files
author
Release Manager
committed
Trac #34506: Override the arbitrary limit on number of digits printed (Python 3.10.7)
Python 3.10.7 brings a breaking change that retroactively affects all Sage versions that accept system Python 3.10.x: https://docs.python.org/3.10/whatsnew/changelog.html#security See also #34271 URL: https://trac.sagemath.org/34506 Reported by: mkoeppe Ticket author(s): David Roe Reviewer(s): Matthias Koeppe
2 parents 08202bc + 20f06e6 commit e421c55

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

build/pkgs/configure/checksums.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=17621baa3704964f752a02c3a1533a8adb59cd3d
3-
md5=e1f4d86a1e996aeee5e5c072bf92f0a1
4-
cksum=3769097678
2+
sha1=b85d5166274c116a578276c7f3a4c81dce03f907
3+
md5=c468fd1ceed66270b7b9940610eeca54
4+
cksum=4220060468
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2e5af062ddd382d2d0eb8070dd0c6e872b77b6bd
1+
3e4ee897d7e994b1fb8495b20da675425a43c50d

src/sage/all.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
<class 'sage.misc.lazy_import.LazyImport'>
3939
sage: interacts
4040
<module 'sage.interacts.all' from '...'>
41+
42+
Check that :trac:`34506` is resolved::
43+
44+
sage: x = int('1'*4301)
4145
"""
4246
# ****************************************************************************
4347
# Copyright (C) 2005-2012 William Stein <[email protected]>
@@ -290,6 +294,12 @@ def quit_sage(verbose=True):
290294
sage.misc.lazy_import.finish_startup()
291295

292296

297+
### Python broke large ints; see trac #34506
298+
299+
if hasattr(sys, "set_int_max_str_digits"):
300+
sys.set_int_max_str_digits(0)
301+
302+
293303
def sage_globals():
294304
r"""
295305
Return the Sage namespace.

0 commit comments

Comments
 (0)