Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: windows decoding in marimo convert (#3041)

Myles Scolnickf059581dbb61
diff --git a/marimo/_cli/convert/commands.py b/marimo/_cli/convert/commands.py
index cd139f30ac..b39b77bffb 100644
--- a/marimo/_cli/convert/commands.py
+++ b/marimo/_cli/convert/commands.py
@@ -64,7 +64,7 @@ def convert(
if output:
# Make dirs if needed
maybe_make_dirs(output)
- with open(output, "w") as f:
+ with open(output, "w", encoding="utf-8") as f:
f.write(notebook)
echo(f"Converted notebook saved to {output}")
else:
diff --git a/marimo/_cli/export/commands.py b/marimo/_cli/export/commands.py
index 7a2a01912d..8af8a7c19f 100644
--- a/marimo/_cli/export/commands.py
+++ b/marimo/_cli/export/commands.py
@@ -45,7 +45,7 @@ def watch_and_export(
if output:
# Make dirs if needed
maybe_make_dirs(output)
- with open(output, "w") as f:
+ with open(output, "w", encoding="utf-8") as f:
f.write(data)
f.close()
else: