Skip to content

Conversation

@ntvinh2005
Copy link

This PR updates RustPython’s stdlib code.py and its associated tests
test_code_module.py to match CPython v3.13.1.

  • Copied from CPython tag v3.13.1
  • Ran with:
    cargo run -- -m test -v test_code_module
  • 17 tests run, 11 passed, 6 failed
  • Failures are expected due to known VM differences:
    • SyntaxError wording
    • IndentationError wording
    • Unicode error mismatch
    • Traceback formatting difference

As per #5529, I’m submitting the updated files as-is. Follow-up issues can be filed for the failing cases.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 3, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (2)
  • Lib/code.py is excluded by !Lib/**
  • Lib/test/test_code_module.py is excluded by !Lib/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ShaharNaveh
Copy link
Collaborator

@ntvinh2005 tysm for the PR:)
Can you please update it from CPython 3.13.7 instead? (if there is any difference)

@ntvinh2005
Copy link
Author

Will do it, thanks a lot for your response.

@fanninpm
Copy link
Contributor

fanninpm commented Oct 4, 2025

I believe you can use the following command to test your changes locally:

# this runs all of the tests (not necessary if you know which test is affected)
cargo run --release --features ssl,jit -- -m test -j 1 -u all --slowest --fail-env-changed -v
# this runs only the test suite named "test_whatever" (usually located at `Lib/test/test_whatever.py`)
cargo run --release --features ssl,jit -- -m test -j 1 -u all --slowest --fail-env-changed -v test_whatever

For a list of all resources and more command-line options, you can execute cargo run --release --features ssl,jit -- -m test -h.

@youknowone
Copy link
Member

@ntvinh2005 Thank you for contributing!

Since code.rs is also recently update, please rebase it on the top of upstream/main. (Otherwise merge is also fine)

For the failing tests, you don't need to actually fix the bugs; please add @unittest.expectedFailure # TODO: RUSTPYTHON as other test files.

To update code.py, don't forget to also update Lib/test/test_code.py too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants