Commit 703252ea authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

RF: Accept non-printable characters in JSON

parent 33999995
...@@ -1569,7 +1569,7 @@ def loadMetadata(image): ...@@ -1569,7 +1569,7 @@ def loadMetadata(image):
jsonfile = op.join(dirname, '{}.json'.format(basename)) jsonfile = op.join(dirname, '{}.json'.format(basename))
if op.exists(jsonfile): if op.exists(jsonfile):
with open(jsonfile, 'rt') as f: with open(jsonfile, 'rt') as f:
return json.load(f) return json.load(f, strict=False)
return {} return {}
......
...@@ -187,7 +187,7 @@ def isBIDSFile(filename, strict=True): ...@@ -187,7 +187,7 @@ def isBIDSFile(filename, strict=True):
def loadMetadataFile(filename): def loadMetadataFile(filename):
"""Load ``filename`` (assumed to be JSON), returning its contents. """ """Load ``filename`` (assumed to be JSON), returning its contents. """
with open(filename, 'rt') as f: with open(filename, 'rt') as f:
return json.load(f) return json.load(f, strict=False)
def loadMetadata(filename): def loadMetadata(filename):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment