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)