From 037c0832f5089e435c3c8132d63ae7ec7a1c7fd7 Mon Sep 17 00:00:00 2001 From: Arash Hatami Date: Fri, 27 Feb 2026 11:16:31 +0330 Subject: [PATCH 1/4] fix(modules): test - remove integer string conversion limit --- salt/modules/test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/salt/modules/test.py b/salt/modules/test.py index 3cd9d7d5ea43..2c5a236e1747 100644 --- a/salt/modules/test.py +++ b/salt/modules/test.py @@ -346,6 +346,12 @@ def fib(num): salt '*' test.fib 3 """ + # Remove the limit on the number of digits in an int, + # as Fibonacci numbers grow very quickly. + # The default limit for integer string conversion is 4300 digits, + # which means that num > 20577 will fail with a ValueError. + sys.set_int_max_str_digits(0) + num = int(num) if num < 0: raise ValueError("Negative number is not allowed!") From 6bffcc40e6a214e36605b24a29be08105608b29e Mon Sep 17 00:00:00 2001 From: Arash Hatami Date: Fri, 27 Feb 2026 11:16:54 +0330 Subject: [PATCH 2/4] chore(tests): write new test to check fib limit --- tests/pytests/integration/cli/test_salt_call.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/pytests/integration/cli/test_salt_call.py b/tests/pytests/integration/cli/test_salt_call.py index f927f499c858..5df8b87be1ad 100644 --- a/tests/pytests/integration/cli/test_salt_call.py +++ b/tests/pytests/integration/cli/test_salt_call.py @@ -34,6 +34,11 @@ def test_fib(salt_call_cli): assert ret.data[0] == 2 +def test_fib_str_limit(salt_call_cli): + ret = salt_call_cli.run("test.fib", "20578") + assert ret.returncode == 0 + + def test_fib_txt_output(salt_call_cli): ret = salt_call_cli.run("--output=txt", "test.fib", "3") assert ret.returncode == 0 From 13c6f1cb45e40bf0825830e29ee0196bb6ef9192 Mon Sep 17 00:00:00 2001 From: Arash Hatami Date: Fri, 27 Feb 2026 11:32:01 +0330 Subject: [PATCH 3/4] docs(changelog): new entry for #68770 --- changelog/68770.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/68770.fixed.md diff --git a/changelog/68770.fixed.md b/changelog/68770.fixed.md new file mode 100644 index 000000000000..2f251efa35d1 --- /dev/null +++ b/changelog/68770.fixed.md @@ -0,0 +1 @@ +Remove the integer-to-string conversion limit for `test.fib` function. \ No newline at end of file From e22521e9b137245dd2e97f1033706beb8a154ad4 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Sat, 6 Jun 2026 22:56:16 -0700 Subject: [PATCH 4/4] =?UTF-8?q?Rename=20changelog/68770=E2=86=9268775=20(l?= =?UTF-8?q?inked=20issue=20is=20#68775)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog/{68770.fixed.md => 68775.fixed.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename changelog/{68770.fixed.md => 68775.fixed.md} (90%) diff --git a/changelog/68770.fixed.md b/changelog/68775.fixed.md similarity index 90% rename from changelog/68770.fixed.md rename to changelog/68775.fixed.md index 2f251efa35d1..fbd29bee257e 100644 --- a/changelog/68770.fixed.md +++ b/changelog/68775.fixed.md @@ -1 +1 @@ -Remove the integer-to-string conversion limit for `test.fib` function. \ No newline at end of file +Remove the integer-to-string conversion limit for `test.fib` function.