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

I/O error in JSON read #675

Closed
andychu opened this issue Mar 22, 2020 · 0 comments
Closed

I/O error in JSON read #675

andychu opened this issue Mar 22, 2020 · 0 comments

Comments

@andychu
Copy link
Contributor

andychu commented Mar 22, 2020

After #672


I looked into it more, and while I didn't find the exact issue, the py-yajl binding we're using for JSON isn't great. It needs to use a more straightforward loop like the example here.

https://lloyd.github.io/yajl/

$ bin/osh -c 'json read :x < configure'
lexical error: invalid char in json text.
                                       #!/bin/sh # # POSIX shell scrip
                     (right here) ------^
  json read :x < configure
       ^~~~
[ -c flag ]:1: json read: parse error
Error closing descriptor 0: [Errno 9] Bad file descriptor
osh I/O error: Bad file descriptor


Though it doesn't look like the binding closes the file descriptor, which would be the obvious bug

andychu pushed a commit that referenced this issue Mar 22, 2020
@andychu andychu closed this as completed Mar 22, 2020
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

1 participant