Repository: RustPython/RustPython (language: rust)

Issue:
sys.flags.int_max_str_digits is not -1
## Summary

sys.flags.int_max_str_digits now returns sys.get_int_max_str_digits().

Introduced from https://github.com/RustPython/RustPython/pull/5127/files#diff-128fff16ea63b541718887f5c714e0c1a357414fe1146b4893ef699e8853e3b0R953

Related RustPython code is `vm/src/stdlib.sys.rs`  `Flags::int_max_str_digits`.

Not sure yet if we need to change the value of Settings or sys::Flags.

sys.flags.int_max_str_digits is not -1
## Summary

sys.flags.int_max_str_digits now returns sys.get_int_max_str_digits().

Introduced from https://github.com/RustPython/RustPython/pull/5127/files#diff-128fff16ea63b541718887f5c714e0c1a357414fe1146b4893ef699e8853e3b0R953

Related RustPython code is `vm/src/stdlib.sys.rs`  `Flags::int_max_str_digits`.

Not sure yet if we need to change the value of Settings or sys::Flags.



Discussion / hints:
Is this fixed now?
in rustpython (317f4494)
sys.flags.int_max_str_digits returns -1
sys.get_int_max_str_digits() returns 4300
in cpython 3.11.6
same results as above.

Also, worked fine with `-X int_max_str_digits` flag
> in cpython 3.11.6

Have you tried CPython 3.12?
> > in cpython 3.11.6
> 
> Have you tried CPython 3.12?

Tried latest cpython (3.13 dev version)
both sys.flags.int_max_str_digits and sys.get_int_max_str_digits() returns 4300
its coming from here: https://github.com/python/cpython/pull/96499
Is this fixed now?
in rustpython (317f4494)
sys.flags.int_max_str_digits returns -1
sys.get_int_max_str_digits() returns 4300
in cpython 3.11.6
same results as above.

Also, worked fine with `-X int_max_str_digits` flag
> in cpython 3.11.6

Have you tried CPython 3.12?
> > in cpython 3.11.6
> 
> Have you tried CPython 3.12?

Tried latest cpython (3.13 dev version)
both sys.flags.int_max_str_digits and sys.get_int_max_str_digits() returns 4300
its coming from here: https://github.com/python/cpython/pull/96499

Fix patch:
diff --git a/vm/src/vm/setting.rs b/vm/src/vm/setting.rs
index 62360aaced..36bb9cee6d 100644
--- a/vm/src/vm/setting.rs
+++ b/vm/src/vm/setting.rs
@@ -151,7 +151,7 @@ impl Default for Settings {
             check_hash_pycs_mode: "default".to_owned(),
             allow_external_library: cfg!(feature = "importlib"),
             utf8_mode: 1,
-            int_max_str_digits: -1,
+            int_max_str_digits: 4300,
             #[cfg(feature = "flame-it")]
             profile_output: None,
             #[cfg(feature = "flame-it")]


Test patch:
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 6644a3cd5c..bda1f78223 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -928,8 +928,6 @@ def test_parsing_error(self):
         self.assertTrue(proc.stderr.startswith(err_msg), proc.stderr)
         self.assertNotEqual(proc.returncode, 0)
 
-    # TODO: RUSTPYTHON
-    @unittest.expectedFailure
     def test_int_max_str_digits(self):
         code = "import sys; print(sys.flags.int_max_str_digits, sys.get_int_max_str_digits())"