Fix WheelSlot writing invalid empty MediaFileName="" on every slot - #27
Merged
vanous merged 1 commit intoJul 24, 2026
Merged
Conversation
WheelSlot._read_xml() read a missing MediaFileName as "" instead of
None (xml_node.attrib.get("MediaFileName", "") defaults to an empty
string, not None). to_xml() only checks "is self.media_file_name not
None" - since a Resource("") was always constructed, every wheel slot
got MediaFileName="" written back out on round-trip, even slots that
never had that attribute in the source file.
Harmless to the XSD (empty string is still a valid attribute value),
but it pollutes every wheel slot on round-trip. Same root cause as the
LuminousIntensity fix in open-stage#26: read with a truthy default instead of
None, write unconditionally instead of checking whether the source
actually had the attribute.
Also includes the same CHANGELOG.md formatting fix as open-stage#26 (ruff
`latest` reformats markdown-embedded Python code fences; master is
currently failing "Check if code is formatted" independent of either
PR) so this PR's CI is green on its own regardless of merge order.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
WheelSlot._read_xml() read a missing MediaFileName as "" instead of None (xml_node.attrib.get("MediaFileName", "") defaults to an empty string, not None). to_xml() only checks "is self.media_file_name not None" - since a Resource("") was always constructed, every wheel slot got MediaFileName="" written back out on round-trip, even slots that never had that attribute in the source file.
Harmless to the XSD (empty string is still a valid attribute value), but it pollutes every wheel slot on round-trip. Same root cause as the LuminousIntensity fix in #26: read with a truthy default instead of None, write unconditionally instead of checking whether the source actually had the attribute.
Also includes the same CHANGELOG.md formatting fix as #26 (ruff
latestreformats markdown-embedded Python code fences; master is currently failing "Check if code is formatted" independent of either PR) so this PR's CI is green on its own regardless of merge order.