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
11 changes: 9 additions & 2 deletions altair/utils/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ 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=kwargs.get("encoding", "utf-8")
)
elif format == "html":
if inline:
kwargs["template"] = "inline"
Expand All @@ -157,7 +159,12 @@ 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=kwargs.get("encoding", "utf-8"),
)
elif format in ["png", "svg", "pdf", "vega"]:
mimebundle = spec_to_mimebundle(
spec=spec,
Expand Down
2 changes: 1 addition & 1 deletion altair/vegalite/v5/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3247,7 +3247,7 @@ def add_selection(self, *selections) -> Self:


def repeat(
repeater: Literal["row", "column", "repeat", "layer"] = "repeat"
repeater: Literal["row", "column", "repeat", "layer"] = "repeat",
) -> core.RepeatRef:
"""Tie a channel to the row or column within a repeated chart

Expand Down