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: sandbox alerts to stderr (#4635)

Dylan Madisetti2bc7dfefe87c
diff --git a/marimo/_cli/sandbox.py b/marimo/_cli/sandbox.py
index 1ba168e756..a7813159eb 100644
--- a/marimo/_cli/sandbox.py
+++ b/marimo/_cli/sandbox.py
@@ -195,6 +195,7 @@ def maybe_prompt_run_in_sandbox(name: str | None) -> bool:
bold=True,
),
default=True,
+ err=True,
)
else:
echo(
@@ -374,7 +375,7 @@ def run_in_sandbox(
args, name, additional_features or [], additional_deps or []
)
- echo(f"Running in a sandbox: {muted(' '.join(uv_cmd))}")
+ echo(f"Running in a sandbox: {muted(' '.join(uv_cmd))}", err=True)
env = os.environ.copy()
env["MARIMO_MANAGE_SCRIPT_METADATA"] = "true"
diff --git a/tests/_cli/test_cli_export.py b/tests/_cli/test_cli_export.py
index d24713e50d..6e12f45fcf 100644
--- a/tests/_cli/test_cli_export.py
+++ b/tests/_cli/test_cli_export.py
@@ -353,7 +353,7 @@ class TestExportHTML:
capture_output=True,
)
assert p.returncode == 0, p.stderr.decode()
- output = p.stdout.decode()
+ output = p.stderr.decode()
# Check for sandbox message
assert "Running in a sandbox" in output
assert "uv run --isolated" in output
@@ -892,7 +892,7 @@ class TestExportIpynb:
capture_output=True,
)
assert p.returncode == 0, p.stderr.decode()
- output = p.stdout.decode()
+ output = p.stderr.decode()
# Check for sandbox message
assert "Running in a sandbox" in output
assert "uv run --isolated" in output