Back to Marimo

MW002: unsafe-system-call

docs/guides/lint_rules/rules/unsafe_system_call.md

0.23.9796 B
Original Source

MW002: unsafe-system-call

🌐 WASM āŒ Not Fixable

MW002: System calls that fail in WASM/Pyodide.

What it does

Walks the AST of each cell looking for calls to functions like os.system(), os.fork(), signal.signal(), and breakpoint() that have no meaningful implementation in WASM.

Why is this bad?

These functions depend on OS features (process spawning, signal handling, debugger attachment) that don't exist in a browser environment. They will raise OSError, NotImplementedError, or hang silently.

Examples

Problematic:

python
import os

os.system("ls")

Problematic:

python
breakpoint()

Solution: Remove or guard these calls behind a WASM detection check.

References