[pull] main from RustPython:main#31
Merged
pull[bot] merged 9 commits intosunmy2019:mainfrom Apr 24, 2026
Merged
Conversation
…#7667) Bumps [https://github.com/rbubley/mirrors-prettier](https://github.com/rbubley/mirrors-prettier) from v3.8.1 to 3.8.3. - [Commits](rbubley/mirrors-prettier@v3.8.1...v3.8.3) --- updated-dependencies: - dependency-name: https://github.com/rbubley/mirrors-prettier dependency-version: 3.8.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [https://github.com/astral-sh/ruff-pre-commit](https://github.com/astral-sh/ruff-pre-commit) from v0.15.7 to 0.15.11. - [Release notes](https://github.com/astral-sh/ruff-pre-commit/releases) - [Commits](astral-sh/ruff-pre-commit@v0.15.7...v0.15.11) --- updated-dependencies: - dependency-name: https://github.com/astral-sh/ruff-pre-commit dependency-version: 0.15.11 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#7669) Clear four of the five ShellCheck findings reported in #7653. The fifth finding is in upgrade-pylib.lock.yml — a gh-aw-generated file marked "DO NOT EDIT" whose source .md does not contain the flagged pattern — and is out of scope here; it will resolve via the in-flight gh-aw version bump (#7650). lib-deps-check.yaml: * SC2076: replace `=~ " $module "` (quoted regex interpreted literally) with `== *" $module "*` glob match. Same intent (literal substring), same semantics across regex metachars. * SC2086: quote `$GITHUB_OUTPUT` in the output redirect. update-doc-db.yml: * SC2129: collapse the eight sequential `echo ... >> $OUTPUT_FILE` lines (plus one `cat ... >> $OUTPUT_FILE`) into a single grouped redirect `{ ...; } > "$OUTPUT_FILE"`. Drops the now-redundant `echo -n '' > $OUTPUT_FILE` truncate. * SC2016: add `# shellcheck disable=SC2016` above the block; the backticks in the auto-generated-header comment are literal Markdown, not command substitution. Verified locally with shellcheck 0.11.0: both modified blocks produce no ShellCheck output. Semantic equivalence of the lib-deps-check change confirmed across six test inputs including regex metachars and glob-meaningful characters.
…7670) Sibling fix to #7656 (which handled Vec<Expr>). The same catch-all TypeError ("expected some sort of stmt, but got {}") in Stmt::ast_from_object silently swallowed None, so compile() on an AST with None in a statement-list field (ClassDef.body, Try.body, For.body, etc.) raised TypeError where CPython raises ValueError("None disallowed in statement list"). Add an is_none check before the catch-all, matching the Expr-side shape introduced in #7656. Option<Stmt> positions are unaffected — they short-circuit None earlier in node.rs. Unmasks test_classdef (body=[None] sub-case). Full test.test_ast.test_ast run: 227 tests, 0 unexpected successes, 38 expected failures (was 39).
All three @unittest.skip("TODO: RUSTPYTHON") markers in
datetimetester.py are stale — the tests pass as written on current
main. Probed every assertion in each test body against both CPython
3.13.4 and RustPython: outputs are byte-identical for all unicode
passthrough cases (emoji, lone surrogates, surrogate pairs, null
bytes) in test_strftime_special and for all 11 FixedOffset
comparisons (utcoffset, tzname, dst, hash equality) in test_zones.
Full test.test_datetime run after unmasking: 1803 tests, 0 failures,
0 unexpected successes, 463 skipped (was 469 — 6 test-class inherited
runs now execute successfully).
Part of the skip-test inventory in #7611.
encode_basestring/encode_basestring_ascii took PyUtf8StrRef, so json.dumps(str_with_lone_surrogate) raised UnicodeEncodeError at the Python/Rust boundary before write_json_string ran. CPython's encoder emits \uXXXX under ensure_ascii=True and passes raw WTF-8 otherwise. Switch to PyStrRef + s.as_wtf8(), matching scanstring in the same file. Rewrite write_json_string to accept &Wtf8 and iterate code_point_indices, emitting \uXXXX for surrogates in ascii mode and passing their bytes through otherwise. Stop escaping 0x7F in the ensure_ascii=False path (matches py_encode_basestring). Return Wtf8Buf via the checked from_bytes so invariant breaks panic instead of UB. Fuzzing also exposed two pre-existing ESCAPE_CHARS typos: 0x0B was "\u000" and 0x1B was "\u001" (both missing trailing 'b'). Fixed here. Verified byte-identical with CPython 3.13.4 over 16 manual + 10,000 random fuzz cases. Full test.test_json: 214 tests, 0 failures, 0 unexpected successes. Unmasks test_ascii_non_printable_encode and test_single_surrogate_encode. Decoder path is a follow-up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )