-
Notifications
You must be signed in to change notification settings - Fork 75
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
Remove JSON <--> String conversions when reading/writing files #348
Conversation
…ON data. When reading non-JSON files, return bytes when in binary mode
0c6a6c3
to
747eb56
Compare
The original save state design allowed script authors to choose the serialization format of their choice, but I don't think anyone else was interested in using If this seems too out of scope, we can create an issue for the backlog too. |
I think there's maybe some merit in allowing the e.g. >>> import json
>>> json.dumps("hello world")
'"hello world"'
I lied; the bootloader currently uses |
I've never concentrated on what happens when you update the firmware but I would have assumed it made you choose from the mnu again anyway, and it's so easy to choose an item from the menu that I don't think this would be a huge problem. People usually update the firmware to get new scripts so would likely be returning to the menu by choice anyway |
If we're aware of the (very slight) regression in the bootloader then I'm okay with that too. I've removed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look good to me. I'm a little embarrassed of my original implementation now. This is a good improvement.
I agree that the effect on the bootloader is fine. As long as the user isn't getting an error, and the only result is that they get dumped back in to the menu, then I don't see any harm there.
Two main changes:
bytes
instead ofstr
if the mode is binary & there's an error opening the file