11 Commits
Author SHA1 Message Date
Jeong, YunWon aa59f1ee53 common: share the bzip2 stream engine (#8638)
Move the VM-independent bzip2 stream owner into a `bz2`-gated
`rustpython-common` module beside the zlib and lzma engines, and keep
`rustpython-stdlib` as the Python object and exception adapter.  The adapter no
longer names the `bzip2` crate; the `bz2` feature carries it.

`_bz2` was the last user of the generic `DecompressState` / `DecompressStatus` /
`Decompressor` machinery in `stdlib/src/compression.rs`, so that goes with it;
`DecompressArgs` stays for zlib and lzma.  The decompressor feeds the stream
through the existing `Chunker`, so buffered and freshly supplied input are no
longer joined into a new allocation first.

`test_decompress_after_data_error` passes on the ported engine, so its
`expectedFailure` marker goes.

Assisted-by: Grok
2026-09-02 20:26:14 +09:00
Kwak Byoung Min d50071eaaa bz2: return streaming output from BZ2Compressor.compress() (#8330)
* bz2: return streaming output from BZ2Compressor.compress()

  Return output produced during compression instead of waiting for flush().

  Constraint: Preserve encoder state without flushing the BZ2 stream
  Confidence: high
  Scope-risk: narrow
  Directive: Do not flush merely to retrieve partial output
  Tested: test_bz2; stdlib_bz2.py; prek run --all-files
  Assisted-by: Codex:gpt-5.6-sol

* bz2: remove redundant streaming-output snippet
2026-07-21 00:30:10 +09:00
Shahar Naveh 5d375e3c21 Update some of changed libs and tests from 3.14.5 -> 3.14.6 (part 3) (#8086) 2026-06-12 23:50:07 +09:00
Changjoon 79c8a0afef Resolve PathLike via os.fspath in io.open (#7743)
CPython splits PathLike resolution across two layers: _io.FileIO
preserves the raw argument on .name (low-level contract), while
the high-level open() wrapper resolves it via os.fspath before
delegating. RustPython's io_open skipped that step, so
builtins.open(PathLike).name returned the PathLike object instead
of the resolved str/bytes.

Match Lib/_pyio.py:193-194 by resolving non-int inputs at the
io_open boundary, leaving _io.FileIO unchanged.
2026-05-01 19:44:10 +09:00
Shahar Naveh e195d742af Update test_bz2.py from 3.14.4 (#7608)
* Update `test_bz2.py` from 3.14.4

* Mark failing test
2026-04-15 14:17:27 +09:00
Jeong, YunWon 3e6cb83fc5 Fix test_io expectedFailures
Assisted-by: Codex:gpt-6
2026-02-06 00:15:18 +09:00
Lee Dogeon 9b5eefbb7b Replace _compression with compression and update related too (#6788) 2026-01-19 00:38:51 +09:00
Shahar Naveh 710941c27f Update bz2.py from 3.13.5 (#6055) 2025-08-01 22:16:32 +09:00
Jeong, YunWon b1ecdf38b8 Fix bz2 pickle (#5819) 2025-06-23 08:55:59 +09:00
Noa f0d46bfeaa Finish _bz2 implementation 2025-04-19 23:13:37 -05:00
NakanoMiku 57f9478d16 Add test_bz2.py from CPython v3.12.0 2023-12-24 04:07:12 +08:00