Files
Kwak Byoung Min 62f4c9895a Add StringIO newline tracking (#8539)
* Report observed StringIO newline types

Constraint: Match CPython StringIO newline reporting without changing configured newline translation.
Rejected: Separate newline-tracking representation | reuse the existing SeenNewline bitflags.
Confidence: high
Scope-risk: narrow
Directive: Keep observed newline state separate from the configured newline mode.
Tested: prek run --all-files; test_memoryio; cargo clippy -p rustpython-vm --lib -- -D warnings; workspace tests excluding the macOS C-API baseline SIGSEGV.
Not-tested: Full macOS workspace suite is blocked by the existing rustpython-capi SIGSEGV; the Linux suite is running.
Assisted-by: Codex:gpt-5.6-sol

* Preserve StringIO state boundaries

Reset observed newline state when StringIO is reinitialized and keep the property subject to closed-stream checks.

Constraint: Match CPython StringIO reinitialization and closed-stream behavior.
Rejected: Returning stale or cached newline state | violates StringIO lifecycle semantics.
Confidence: high
Scope-risk: narrow
Directive: Keep observed newline state tied to the current open StringIO contents.
Tested: cargo test --workspace --exclude rustpython_wasm --exclude rustpython-venvlauncher; cargo run --release -- extra_tests/snippets/stdlib_io_stringio.py; cargo run --release -- -m test test_memoryio; prek run --all-files; cargo clippy -p rustpython-vm --lib -- -D warnings.
Assisted-by: Codex:gpt-5.6-sol
2026-08-18 12:38:16 +09:00
..
2026-08-18 12:38:16 +09:00
2026-04-21 00:13:25 +09:00