-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add ExpatError and error to pyexpat
#6889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughA new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] lib: cpython/Lib/xml dependencies:
dependent tests: (7 tests)
Legend:
|
This PR is one of a series of PRs in preparation for getting https://rustpython.github.io/pages/regression-tests-results.html to work again by using the Python test suite to generate a JUnit-compatible XML file (and later converting said XML a JSON format the current website can accept).
In pursuit of that, I discovered that
xml.parsers.expat.errorneeds to be available to the interpreter, and I suspect that it's used to let the Python-side XML machinery report a useful error.Here, I tried to make
pyexpat.erroravailable; however, when I submitted this PR, I came up short of my goal, as I currently don't know a useful way of gettingpyexpat.errorto ailiaspyexpat.ExpatError.In CPython 3.14, the
pyexpatmodule has apyexpat_statestruct that gets initialized with, among other things, a newxml.parsers.expat.ExpatErrorexception.When the
pyxpatmodule is initialized, the two objectserrorandExpatErrorare aliased tostate->Error.If anyone knows how to replicate this behavior in RustPython on the Rust side, I would be glad to implement that.
Summary by CodeRabbit
ExpatErrorexception type for improved error handling in XML parsing operations.✏️ Tip: You can customize this high-level summary in your review settings.