Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble reading in a file #75

Closed
bkamins opened this issue Sep 20, 2020 · 2 comments
Closed

Trouble reading in a file #75

bkamins opened this issue Sep 20, 2020 · 2 comments

Comments

@bkamins
Copy link

bkamins commented Sep 20, 2020

This file https://raw.githubusercontent.com/jeffreylancaster/game-of-thrones/master/episode-character/episode-character.json does not load correctly with an error:

ERROR: ArgumentError: invalid JSON at byte position 1 while parsing type Any: InvalidChar

while JSON.jl reads it in without a problem.

@quinnj
Copy link
Owner

quinnj commented Sep 20, 2020

You need to pass a byte buffer or json string literal as the argument to JSON3.read, not a file name. To read a file, you can do JSON3.read(read(filename))

@quinnj quinnj closed this as completed Sep 20, 2020
@bkamins
Copy link
Author

bkamins commented Sep 21, 2020

Thank you! Right - sorry for mixing up things. A think to consider is making things more consistent across CSV.jl and JSON3.jl (as I just reused the pattern I expected to work without reading the documentation).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants