Title: XML-related test failures · Issue #8083 · RustPython/RustPython · GitHub
Open Graph Title: XML-related test failures · Issue #8083 · RustPython/RustPython
X Title: XML-related test failures · Issue #8083 · RustPython/RustPython
Description: I want to push more on getting RustPython's XML capabilities on par with CPython's, so we can replace extratests/json-tests.py with a more robust solution involving CPython's own test harness (the --junit-xml flag on python -m test). A l...
Open Graph Description: I want to push more on getting RustPython's XML capabilities on par with CPython's, so we can replace extratests/json-tests.py with a more robust solution involving CPython's own test harness (the ...
X Description: I want to push more on getting RustPython's XML capabilities on par with CPython's, so we can replace extratests/json-tests.py with a more robust solution involving CPython's own test h...
Opengraph URL: https://github.com/RustPython/RustPython/issues/8083
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"XML-related test failures","articleBody":"I want to push more on getting RustPython's XML capabilities on par with CPython's, so we can replace `extratests/json-tests.py` with a more robust solution involving CPython's own test harness (the `--junit-xml` flag on `python -m test`). A lot of this may involve making [the `xml` crate](https://lib.rs/crates/xml) \"behave\" more like [the `libexpat` parser](https://github.com/libexpat/libexpat). The goal is not to get **all** of these boxes checked, but to get **enough** of them checked such that, e.g., `rustpython -m test --junit-xml test.xml tests.xmltests` will output valid XML. Here's the current state of play (as of 14 June 2026):\n\n# `Lib/test/test_minidom.py`\n\n- class `MinidomTest`:\n - [ ] `testGetElementsByTagNameNS()`\n - [x] `testWriteXML()` #8305 \n - [x] `testAltNewline()` #8305\n - [ ] `testProcessingInstruction()`\n - [ ] `testProcessingInstructionRepr()`\n - [x] `testRemoveNamedItem()` #8305\n - [x] `testRemoveNamedItemNS()` #8305\n - [x] `testCloneElementShallow()` #8305\n - [x] `testCloneAttributeShallow()` #8305\n - [x] `testCloneAttributeDeep()` #8305\n - [ ] `testClonePIShallow()`\n - [ ] `testClonePIDeep()`\n - [ ] `testCloneNodeEntity()`\n - [ ] `testSiblings()`\n - [ ] `testEncodings()`\n - [x] `testRenameAttribute()` #8305\n - [x] `testSchemaType()` #8305\n - [x] `testSetIdAttribute()` #8305\n - [x] `testSetIdAttributeNS()` #8305\n - [ ] `testSetIdAttributeNode()`\n - [ ] `testExceptionOnSpacesInXMLNSValue()`\n - [x] `test_minidom_attribute_order()` #8305\n - [x] `test_toxml_with_attributes_ordered()` #8305\n - [x] `test_toprettyxml_with_attributes_ordered()` #8305\n - [ ] `test_toprettyxml_with_cdata()`\n\n# `Lib/test/test_pulldom.py`\n\n- class `SAX2DOMTestCase`:\n - [ ] `test_basic()` read from stream io\n- class `PullDOMTestCase`:\n - [x] `test_parse()` FileNotFoundError: [Errno 2] No such file or directory (os error 2): 'xmltestdata/test.xml' -> 'None'\n - [ ] `test_parse_semantics()` implement DOM semantic\n - [ ] `test_expandItem()` pulldom.parseString(SMALL_SAMPLE) return iterator with tuple with 2 elements\n\n# `Lib/test/test_pyexpat.py`\n\n- class `ParseTest`:\n - [ ] `test_parse_bytes()`\n - [ ] `test_parse_str()`\n - [ ] `test_parse_file()`\n - [ ] `test_parse_again()`\n - [ ] `test_supported_encodings()`\n - [ ] `test_supported_encodings2()`\n - [ ] `test_unsupported_encodings()` AssertionError: ValueError not raised\n - [ ] `test_incompatible_encodings()` AssertionError: ExpatError not raised\n - [ ] `test_non_text_encodings()` AssertionError: LookupError not raised\n - [ ] `test_undefined_encoding()` AssertionError: UnicodeError not raised\n - [ ] `test_unknown_encoding()` AssertionError: LookupError not raised\n- class `NamespaceSeparatorTest`:\n - [ ] `test_illegal()`\n- class `InterningTest`:\n - [ ] `test()`\n - [ ] `test_issue9402()`\n- class `BufferTextTest`:\n - [ ] `test_buffering_enabled()`\n - [ ] `test1()`\n - [ ] `test2()`\n - [ ] `test7()`\n- class `sf1296433Test`:\n - [ ] `test_parse_only_xml_data()` TypeError: Expected type 'str' but 'bytes' found.\n- class `ChardataBufferTest`:\n - [ ] `test_1025_bytes()`\n - [ ] `test_1000_bytes()`\n - [ ] `test_wrong_size()`\n - [ ] `test_unchanged_size()`\n - [ ] `test_disabling_buffer()`\n - [ ] `test_change_size_1()`\n - [ ] `test_change_size_2()`\n- class `ElementDeclHandlerTest`:\n - [ ] `test_trigger_leak()` AssertionError: TypeError not raised by Parse\n - [ ] `test_deeply_nested_content_model()` AssertionError: RecursionError not raised\n- class `MalformedInputTest`:\n - [ ] `test1()`\n - [ ] `test2()`\n- class `ErrorMessageTest`:\n - [ ] `test_codes()`\n - [ ] `test_expaterror()`\n- class `ForeignDTDTest`:\n - [ ] `test_use_foreign_dtd()`\n - [ ] `test_ignore_use_foreign_dtd()`\n- class `ParentParserLifetimeTest`:\n - [ ] `test_parent_parser_outlives_its_subparsers__single()` AttributeError: 'xmlparser' object has no attribute 'ExternalEntityParserCreate'\n - [ ] `test_parent_parser_outlives_its_subparsers__multiple()` AttributeError: 'xmlparser' object has no attribute 'ExternalEntityParserCreate'\n - [ ] `test_parent_parser_outlives_its_subparsers__chain()` AttributeError: 'xmlparser' object has no attribute 'ExternalEntityParserCreate'\n- class `ReparseDeferralTest`:\n - [ ] `test_getter_setter_round_trip()` AttributeError: 'xmlparser' object has no attribute 'GetReparseDeferralEnabled'\n - [ ] `test_reparse_deferral_enabled()` AttributeError: 'xmlparser' object has no attribute 'GetReparseDeferralEnabled'\n - [ ] `test_reparse_deferral_disabled()` AttributeError: 'xmlparser' object has no attribute 'SetReparseDeferralEnabled'\n- class `ExpansionProtectionTest`: [N.B. this gets appended at the end of the current list]\n - [ ] `test_set_activation_threshold__threshold_reached()` AttributeError: 'xmlparser' object has no attribute 'SetBillionLaughsAttackProtectionMaximumAmplification'\n - [ ] `test_set_activation_threshold__threshold_not_reached()` AttributeError: 'xmlparser' object has no attribute 'SetBillionLaughsAttackProtectionMaximumAmplification'\n - [ ] `test_set_maximum_amplification__amplification_exceeded()` AttributeError: 'xmlparser' object has no attribute 'SetBillionLaughsAttackProtectionMaximumAmplification'\n - [ ] `test_set_maximum_amplification__amplification_not_exceeded()` AttributeError: 'xmlparser' object has no attribute 'SetBillionLaughsAttackProtectionMaximumAmplification'\n - [ ] `test_set_activation_threshold__fail_for_subparser()` AttributeError: 'xmlparser' object has no attribute 'SetBillionLaughsAttackProtectionMaximumAmplification'\n - [ ] `test_set_activation_threshold__invalid_threshold_type()` AttributeError: 'xmlparser' object has no attribute 'SetBillionLaughsAttackProtectionMaximumAmplification'\n - [ ] `test_set_maximum_amplification__fail_for_subparser()` AttributeError: 'xmlparser' object has no attribute 'SetBillionLaughsAttackProtectionMaximumAmplification'\n - [ ] `test_set_maximum_amplification__infinity()` AttributeError: 'xmlparser' object has no attribute 'SetBillionLaughsAttackProtectionMaximumAmplification'\n - [ ] `test_set_maximum_amplification__invalid_max_factor_range()` AttributeError: 'xmlparser' object has no attribute 'SetBillionLaughsAttackProtectionMaximumAmplification'\n - [ ] `test_set_maximum_amplification__invalid_max_factor_type()` AttributeError: 'xmlparser' object has no attribute 'SetBillionLaughsAttackProtectionMaximumAmplification'\n\n# `Lib/test/test_sax.py`\n\n- class `ParseTest`:\n - [ ] `test_parse_text()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_parse_bytes()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [x] `test_parse_path_object()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_parse_InputSource()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_parse_close_source()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `check_parseString()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n N.B. erroneous?\n - [ ] `test_parseString_text()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_parseString_bytes()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n- class `XmlGenTest`:\n - [ ] `test_5027_1()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n- class `ExpatReaderTest`:\n - [ ] `test_expat_binary_file()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_text_file()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_binary_file_nonascii()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_binary_file_bytes_name()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_binary_file_int_name()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_dtdhandler_support()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_external_dtd_enabled()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [x] `test_expat_external_dtd_default()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_entityresolver_enabled()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_entityresolver_default()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [x] `test_expat_attrs_empty()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [x] `test_expat_attrs_wattr()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [x] `test_expat_nsattrs_empty()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_nsattrs_wattr()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_inpsource_filename()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_inpsource_sysid()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_inpsource_sysid_nonascii()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_inpsource_byte_stream()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_inpsource_character_stream()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_incremental()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_incremental_reset()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_flush_reparse_deferral_enabled()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_flush_reparse_deferral_disabled()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [x] `test_expat_locator_noinfo()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [x] `test_expat_locator_withinfo()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [x] `test_expat_locator_withinfo_nonascii()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n- class `ErrorReportingTest`:\n - [ ] `test_expat_inpsource_location()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n - [ ] `test_expat_incomplete()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n- class `LexicalHandlerTest`:\n - [ ] `test_handlers()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n- class `CDATAHandlerTest`:\n - [ ] `test_handlers()` AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'\n\n# `Lib/test/test_xml_dom_minicompat.py`\n\nNo tests fail.\n\n# `Lib/test/test_xml_dom_xmlbuilder.py`\n\nNo tests fail.\n\n# `Lib/test/test_xml_etree.py`\n\n- class `ElementTreeTest`:\n - [x] `test_file_init()` #8305\n - [x] `test_parsefile()` #8305\n - [ ] `test_parseliteral()`\n - [ ] `test_custom_builder()`\n - [ ] `test_custom_builder_only_end_ns()`\n - [x] `test_children()` #8305\n - [ ] `test_encoding()`\n - [ ] `test_entity()`\n - [x] `test_namespace()` #8305\n - [ ] `test_attlist_default()`\n- class `IterparseTest`:\n - [x] `test_basic()` #8305\n - [x] `test_external_file()` #8305\n - [x] `test_events()` #8305\n - [ ] `test_namespace_events()`\n - [ ] `test_non_utf8()`\n - [ ] `test_parsing_error()`\n - [x] `test_resource_warnings_not_exhausted()` #8305\n - [ ] `test_resource_warnings_failed_iteration()`\n - [x] `test_close_not_exhausted()` #8305\n- class `XMLPullParserTest`:\n - [ ] `test_simple_xml()`\n - [ ] `test_simple_xml_chunk_1()`\n - [ ] `test_simple_xml_chunk_5()`\n - [ ] `test_simple_xml_chunk_22()`\n - [ ] `test_feed_while_iterating()`\n - [ ] `test_simple_xml_with_ns()`\n - [ ] `test_ns_events()`\n - [ ] `test_ns_events_start()`\n - [ ] `test_ns_events_start_end()`\n - [ ] `test_events()`\n - [ ] `test_events_comment()`\n - [ ] `test_events_pi()`\n - [ ] `test_flush_reparse_deferral_enabled()`\n - [ ] `test_flush_reparse_deferral_disabled()`\n - [x] `test_xinclude_default()` #8305\n - [x] `test_xinclude()` #8305\n - [x] `test_xinclude_repeated()` #8305\n - [x] `test_xinclude_failures()` #8305\n- class `BugsTest`:\n - [x] `test_bug_xmltoolkit25()` #8305\n - [x] `test_bug_xmltoolkit39()` #8305\n - [ ] `test_bug_xmltoolkit55()`\n - [ ] `test_bug_xmltoolkit63()`\n - [x] `test_bug_200708_newline()` #8305\n - [x] `test_issue6565()` #8305\n - [ ] `test_lost_elem()`\n - [x] `test_expat224_utf8_bug()` #8305\n - [ ] `test_expat224_utf8_bug_file()`\n- class `BadElementTest`:\n - [ ] `test_deeply_nested_deepcopy()`\n- class `ElementFindTest`:\n - [x] `test_find_simple()` #8305\n - [x] `test_find_xpath()` #8305\n - [x] `test_findall()` #8305\n - [x] `test_find_through_ElementTree()` #8305\n- class `TreeBuilderTest`:\n - [ ] `test_late_tail_mix_pi_comments()`\n - [ ] `test_doctype()`\n- class `XMLParserTest`:\n - [ ] `test_subclass_doctype()`\n - [ ] `test_parse_string()`\n- class `ParseErrorTest`:\n - [ ] `test_error_position()`\n - [ ] `test_error_code()`\n- class `BoolTest`:\n - [x] `test_warning()` #8305\n- class `C14NTest`:\n - [ ] `test_simple_roundtrip()`\n - [ ] `test_c14n_exclusion()`\n - [ ] `test_xml_c14n2()`\n\n# `Lib/test/test_xml_etree_c.py`\n\nNo tests fail.\n\n# `Lib/test/test_xmlrpc.py`\n\n- class `XMLRPCTestCase`:\n - [ ] `test_dump_encoding()`\n - [ ] `test_loads_unsupported()`\n - [ ] `test_load_extension_types()`\n- class `SimpleServerTestCase`:\n - [ ] `test_client_encoding()`\n- class `SimpleServerEncodingTestCase`:\n - [ ] `test_server_encoding()`\n","author":{"url":"https://github.com/fanninpm","@type":"Person","name":"fanninpm"},"datePublished":"2026-06-11T22:05:21Z","url":"https://github.com/RustPython/RustPython/issues/8083"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:51798d99-e956-fe63-a825-5440c9c4752f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CAA4:31E99C:2F0624E:3EBC66F:6B01DDFB |
| html-safe-nonce | 64f0fd586cd40a7ed438ae7b17e62aecb2ca6b8517858c8b8a605c69c93978d2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQUE0OjMxRTk5QzoyRjA2MjRFOjNFQkM2NkY6NkIwMURERkIiLCJ2aXNpdG9yX2lkIjoiNDY2MzQxMDA2MjI2MDI5NzIxMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6db8bd915841d4c6ff81f0ef62a1c61e8a77dd4fa718a9482bf984d7c66d25b3 |
| hovercard-subject-tag | issue:4644538265 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/RustPython/RustPython/8083/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ac94a306d1f44920767a6f0760c698436692145ab42a10fc0cff391faf91ad0f/RustPython/RustPython/issues/8083 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ac94a306d1f44920767a6f0760c698436692145ab42a10fc0cff391faf91ad0f/RustPython/RustPython/issues/8083 |
| og:image:alt | I want to push more on getting RustPython's XML capabilities on par with CPython's, so we can replace extratests/json-tests.py with a more robust solution involving CPython's own test harness (the ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fanninpm |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width