Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fslpy
Commits
a4b45be2
Commit
a4b45be2
authored
Oct 27, 2021
by
Paul McCarthy
🚵
Browse files
RF: Accept non-printable characters in JSON
parent
48984e01
Changes
2
Hide whitespace changes
Inline
Side-by-side
fsl/data/image.py
View file @
a4b45be2
...
...
@@ -1569,7 +1569,7 @@ def loadMetadata(image):
jsonfile
=
op
.
join
(
dirname
,
'{}.json'
.
format
(
basename
))
if
op
.
exists
(
jsonfile
):
with
open
(
jsonfile
,
'rt'
)
as
f
:
return
json
.
load
(
f
)
return
json
.
load
(
f
,
strict
=
False
)
return
{}
...
...
fsl/utils/bids.py
View file @
a4b45be2
...
...
@@ -187,7 +187,7 @@ def isBIDSFile(filename, strict=True):
def
loadMetadataFile
(
filename
):
"""Load ``filename`` (assumed to be JSON), returning its contents. """
with
open
(
filename
,
'rt'
)
as
f
:
return
json
.
load
(
f
)
return
json
.
load
(
f
,
strict
=
False
)
def
loadMetadata
(
filename
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment