Skip to content

Commit

Permalink
feat: deserialise python path objects
Browse files Browse the repository at this point in the history
deserialise path objects in outs
  • Loading branch information
govinda-kamath authored May 13, 2024
1 parent cecd202 commit d873cf4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions adapters/python/martian.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import resource
import subprocess
import sys
from pathlib import PurePath


from typing import ( # pylint: disable=import-error, unused-import
Expand Down Expand Up @@ -98,6 +99,8 @@ def json_sanitize(data):
pass
elif isinstance(data, bytes):
retval = data.decode("utf-8", errors="ignore")
elif isinstance(data, PurePath):
retval = str(data)
elif hasattr(data, "__iter__"):
# Recurse on lists.
retval = [json_sanitize(d) for d in data]
Expand Down

0 comments on commit d873cf4

Please sign in to comment.