-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
My build system is setup to copy files to the simulation directory, so I can load them without any relative or absolute path specification. Doing so causes problems with the jsonLoad function.
jsonLoadcallsdecodeon the input string, which causes a bunch of errors. Thedecodefunction looks for specific non-alphanumeric characters in the first or second position of the string in order to detect a file path vs. encoded string.jsonLoadchecks for".json"in the decoded string (raw) instead of the input string. Because all of the hex decode calls failed on my path, there isn't anything interesting in the decoded string. SojsonLoadtries to parse my file name as a JSON string.
One workaround in my code would be to specify a path ./my_file_name.json instead of just my_file_name.json. Another is to call jsonReadFile directly. I picked the latter.
Long-term, I suggest either splitting jsonLoad to be less of a "do what I mean" function, or making it smarter so it does what I mean in this case.
Metadata
Metadata
Assignees
Labels
No labels