Skip to content

Commit

Permalink
fix: decode bytes to produce a string
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
oesteban committed Jan 13, 2025
1 parent 9c784c9 commit 4c840a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mriqc/interfaces/webapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4c840a2

Please sign in to comment.