From 14aa78e3a9b1486083badfd63789bb36b196e712 Mon Sep 17 00:00:00 2001 From: guzzijones12 Date: Mon, 8 Sep 2025 12:57:40 -0400 Subject: [PATCH 1/2] utf-8 encode before checking max size; 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..1252c80253 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("utf-8", 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 2c1fd7cf58e6d435b1ab91e7b6128388195da9db Mon Sep 17 00:00:00 2001 From: guzzijones12 Date: Mon, 8 Sep 2025 13:06:49 -0400 Subject: [PATCH 2/2] black fixes --- contrib/runners/python_runner/python_runner/python_runner.py | 2 +- 1 file changed, 1 insertion(+), 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 1252c80253..9bba07985f 100644 --- a/contrib/runners/python_runner/python_runner/python_runner.py +++ b/contrib/runners/python_runner/python_runner/python_runner.py @@ -189,7 +189,7 @@ def run(self, action_parameters): stdin = None stdin_params = None if ( - len(serialized_parameters.encode("utf-8", errors="ignore")) + len(serialized_parameters.encode(sys.getdefaultencoding(), errors="ignore")) >= MAX_PARAM_LENGTH ): stdin = subprocess.PIPE