Repository navigation
Conversation
|
@anhnt256 is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
🤖 auto-maintain reviewAutomated, advisory triage for
Review panel: 🟡 medium highest severity just-bash maintainer code review: 🟡 medium
General code review: 🟢 low
Adversarial security: 🟡 medium
Adversarial security (second opinion): 🟢 low
Standard Bash and host portability: 🟡 medium
Posted by auto-maintain. This automated code review is advisory; a human maintainer makes the call. |
privatenumber
left a comment
There was a problem hiding this comment.
Pushed follow-ups to tighten option parsing and docs:
- Validate remaining bundled flags and operands before returning version (
-IVZ,-IVc). - Handle
-h/--helpsequentially inparseArgsso-IVZ --helprejects-Zand script/module--helpis passed through. - Clarify in
--helpand the changeset that-I/-E/-s/-Pare accepted as compatibility no-ops without modifyingsys.flags,PYTHONBREAKPOINT, or runtimesys.path. - Simplified the parser and expanded
python3.isolation.test.ts.
Python3 WASM tests, typecheck, and lint all pass. Looks good to merge.
Fixes #781
python3 -I,-E,-sand-P(alone or bundled, e.g.-Ic,-IE) failed withpython3: unrecognized option, so agent-written Python using-Ifor untrusted files could not run at all.The sandbox already provides what these flags promise — a fixed
sys.pathwith no script/cwd directory or user site-packages, andPYTHONPATHnever reachessys.path— so this accepts the flags in the option parser and runs the code normally. A bundled-c/-malso accepts an attached argument now (-c'print(1)'), matching CPython.Verification:
python3 -I -c 'print(1)',-Ic,-IE,-E,-s,-P,-Is,-IP→ exit 0,1python3 -I script.py,python3 -I -m json.tool,python3 -I -V→ exit 0PYTHONPATH=/tmp/evil python3 -I -c 'import sys; print(sys.path)'→ no/tmp/evil;import jsonstill loads from/lib/python313.zip--unknown,-xand-Ixstill exit 2 withunrecognized option;-Icwith no argument still exits 2tsc --noEmitclean,biome checkclean