* Add host_env feature for sandbox isolation
Introduce a `host_env` feature flag that gates all host environment
access (filesystem, network, signals, processes). When disabled,
the VM operates in sandbox mode:
- _io module always available; FileIO gated by host_env
- SandboxStdio provides lightweight stdin/stdout/stderr via Rust std::io
- BytesIO/StringIO/BufferedIO/TextIOWrapper work without host_env
- open() returns UnsupportedOperation in sandbox
- stdlib modules (os, socket, signal, etc.) gated by host_env
- CI checks both host_env ON and OFF builds
* Auto-format: ruff check --select I --fix
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Refine documentation in interpreter.rs
Improve InterpreterConfig with convenience methods (with_debug, add_path, add_paths), better documentation with working examples, refactored stdlib setup into focused functions, and comprehensive unit tests while maintaining 100% backward compatibility.
* Improve error message for non-Unicode paths
* Use consistent make_module naming in all doc examples
* cut useful changes
---------
Co-authored-by: Mohamed Gharbi <galaxysea777@gmail.com>
* * Added alloc_instead_of_core, std_instead_of_alloc, and std_instead_of_core clippy rules
* Manually changed part of the code to use core/alloc
* use clippy --fix to fix issues in stdlib
* * Used clippy --fix to fix issues in vm
* Imported Range in vm/src/anystr.rs
* * Used clippy --fix to fix issues in common
* Update ruff to 0.14.1
* Fix test regression in `test_compile`
* Unmark passing test
* Update `test_syntax` from 3.13.9
---------
Co-authored-by: Noa <coolreader18@gmail.com>
There aren't any tests but being able to do nested for loops seems like
a pretty big win to me so I'm going to put up for review.
The original returned boolean clearly had **false positives** for
detecting bad errors for things like nested `if` and `for` statements.
What is less clear is if there are any **true positives** which I am no
longer catching with the updated return value.
Co-authored-by: Jack O'Connor <jack@jackoconnor.dev>
* continue accepting REPL input for multiline strings
* Match cpython behavior for all multi-line statements (execute when complete)
* Emit _IncompleteInputError when compiling with incomplete flag
* Refine when _IncompleteInputError is emitted
* Support multiline strings emitting _IncompleteInputError
* lint
* Undo accidental change to PyTabError
* match -> if let
* Fix test_baseexception and test_codeop
* fix spelling
* fix exception name
* Skip pickle test of _IncompleteInputError
* Use py3.15's codeop implementation
* Update Lib/test/test_baseexception.py
---------
Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>