-
Notifications
You must be signed in to change notification settings - Fork 794
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
Update save.py to use utf-8 instead of None per default #3278
Conversation
I experience issues with the Null on windows. It appears as if when saving HTML, the template is already utf-8 and when writing the files with the system default code page, there are encoding issues.
Thanks for the contribution @franzhaas. Setting the default encoding to So I think you'll need to move the default encoding up a level and set it for only the |
- completely unchecked... trusting CI...
I think it's now ok. ...I need to get into the habit of using my account to run CI... |
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.
Thanks @franzhaas,
While reviewing, I noticed that for svg
and vega
formats, we look for an encoding
kwarg and then fall back to utf-8 if it's not present. I think this makes sense for json
and html
formats as well. I added suggestions, so I added review suggestions that make this change.
Not a requirement for this PR, but it would be good to add encoding as an explicit argument to save
with a default value of utf-8
and add it to the docstring. Right now it's basically a secret keyword argument.
for consistence with svg export, I added suggestions to honor an encoding
argument passed into the function
Co-authored-by: Jon Mease <jonmmease@gmail.com>
Co-authored-by: Jon Mease <jonmmease@gmail.com>
I think it is ok now... I personally would prefer to not have the encoding parameter explicit, working by default and the ability to pass an IO object when specific encodings are necessary appear to be a good and compact solution too me. |
Thanks @franzhaas, one last formatting fix needed to get the tests passing and this is good to go! Edit: sorry, I posted and deleted a comment here that was meant for another thread |
- fixed formating... wired...
I am a bit confused about that one... I cant remember to have touched this file... and i see nothing in the logs... also it didn't trigger on my own CI run... but sure i fixed it... |
Thanks! Maybe ruff released an update. |
I experience issues with the Null on windows. It appears as if when saving HTML, the template is already utf-8 and when writing the files with the system default code page, there are encoding issues.
Alternatively I see another options to solve my problem.:
set it only in the
elif format == "html":
branch...