From a0e9f38ba6c7aa8b70469d1e00d8487bbc4742f0 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Mon, 13 Jan 2025 10:39:40 +0100 Subject: [PATCH] fix: decode bytes to produce a string With the new JSON library, ``dumps()`` seems to return bytes. Here we decode the output of ``dumps()``, ensuring the output is converted into text. This effectively should address the issue linked below. Resolves: #1352. --- mriqc/interfaces/webapi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mriqc/interfaces/webapi.py b/mriqc/interfaces/webapi.py index 123d8410..221938d8 100644 --- a/mriqc/interfaces/webapi.py +++ b/mriqc/interfaces/webapi.py @@ -163,8 +163,8 @@ def _run_interface(self, runtime): | orjson.OPT_APPEND_NEWLINE | orjson.OPT_SERIALIZE_NUMPY ), - ) - Path('payload.json').write_bytes(payload_str) + ).decode('utf-8') + Path('payload.json').write_text(payload_str) self._results['payload_file'] = str(Path('payload.json').absolute()) try: