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

Update save.py to use utf-8 instead of None per default #3278

Merged
merged 12 commits into from
Dec 6, 2023
6 changes: 4 additions & 2 deletions altair/utils/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def perform_save():

if format == "json":
json_spec = json.dumps(spec, **json_kwds)
write_file_or_filename(fp, json_spec, mode="w")
write_file_or_filename(fp, json_spec, mode="w", encoding="utf-8")
franzhaas marked this conversation as resolved.
Show resolved Hide resolved
elif format == "html":
if inline:
kwargs["template"] = "inline"
Expand All @@ -157,7 +157,9 @@ def perform_save():
json_kwds=json_kwds,
**kwargs,
)
write_file_or_filename(fp, mimebundle["text/html"], mode="w")
write_file_or_filename(
fp, mimebundle["text/html"], mode="w", encoding="utf-8"
franzhaas marked this conversation as resolved.
Show resolved Hide resolved
)
elif format in ["png", "svg", "pdf", "vega"]:
mimebundle = spec_to_mimebundle(
spec=spec,
Expand Down