From a7062301f55c034538f92de3e989ddff1147db04 Mon Sep 17 00:00:00 2001 From: guzzijones12 Date: Mon, 8 Sep 2025 13:06:49 -0400 Subject: [PATCH 1/4] black fixes --- contrib/runners/python_runner/python_runner/python_runner.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/runners/python_runner/python_runner/python_runner.py b/contrib/runners/python_runner/python_runner/python_runner.py index a8200e0bb3..9bba07985f 100644 --- a/contrib/runners/python_runner/python_runner/python_runner.py +++ b/contrib/runners/python_runner/python_runner/python_runner.py @@ -188,7 +188,10 @@ def run(self, action_parameters): # failure to fork the wrapper process when using large parameters. stdin = None stdin_params = None - if len(serialized_parameters) >= MAX_PARAM_LENGTH: + if ( + len(serialized_parameters.encode(sys.getdefaultencoding(), errors="ignore")) + >= MAX_PARAM_LENGTH + ): stdin = subprocess.PIPE LOG.debug("Parameters are too big...changing to stdin") stdin_params = '{"parameters": %s}\n' % (serialized_parameters) From 491d4337b397c2987dfbac3bfdfee1c7d98aab6e Mon Sep 17 00:00:00 2001 From: guzzijones12 Date: Wed, 22 Jul 2026 10:43:55 -0400 Subject: [PATCH 2/4] add changelog --- CHANGELOG.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 573ca0f015..0a6500d98e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,6 +17,7 @@ Redis 8.6 Fixed ~~~~~ * Fix ``TypeError`` when displaying help for actions whose parameters have no ``description`` key. #6375 +* Fix utf-8 encode before checking paramter max size #6352 Changed ~~~~~~~ From 158dac4cda5c3511a082e2fa1f7a31fd07d11160 Mon Sep 17 00:00:00 2001 From: guzzijones12 Date: Wed, 22 Jul 2026 10:54:30 -0400 Subject: [PATCH 3/4] mock sys getdefaultencoding --- contrib/runners/python_runner/tests/unit/test_pythonrunner.py | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/runners/python_runner/tests/unit/test_pythonrunner.py b/contrib/runners/python_runner/tests/unit/test_pythonrunner.py index 22d9e14b36..f66d6f8f50 100644 --- a/contrib/runners/python_runner/tests/unit/test_pythonrunner.py +++ b/contrib/runners/python_runner/tests/unit/test_pythonrunner.py @@ -97,6 +97,7 @@ mock_sys = mock.Mock() mock_sys.argv = [] mock_sys.executable = sys.executable +mock_sys.getdefaultencoding.return_value = sys.getdefaultencoding() MOCK_EXECUTION = mock.Mock() MOCK_EXECUTION.id = "598dbf0c0640fd54bffc688b" From 19d0d473b0402b879ce16c73f36252df2ead74e0 Mon Sep 17 00:00:00 2001 From: guzzijones12 Date: Wed, 22 Jul 2026 11:22:22 -0400 Subject: [PATCH 4/4] another mock sys --- contrib/runners/python_runner/tests/unit/test_output_schema.py | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/runners/python_runner/tests/unit/test_output_schema.py b/contrib/runners/python_runner/tests/unit/test_output_schema.py index c5fd0d00e2..fe09df162d 100644 --- a/contrib/runners/python_runner/tests/unit/test_output_schema.py +++ b/contrib/runners/python_runner/tests/unit/test_output_schema.py @@ -40,6 +40,7 @@ MOCK_SYS = mock.Mock() MOCK_SYS.argv = [] MOCK_SYS.executable = sys.executable +MOCK_SYS.getdefaultencoding.return_value = sys.getdefaultencoding() MOCK_EXECUTION = mock.Mock() MOCK_EXECUTION.id = "598dbf0c0640fd54bffc688b"