Skip to content

Fix WheelSlot writing invalid empty MediaFileName="" on every slot - #27

Merged
vanous merged 1 commit into
open-stage:masterfrom
Light-oneNL:fix/wheelslot-empty-mediafilename
Jul 24, 2026
Merged

Fix WheelSlot writing invalid empty MediaFileName="" on every slot#27
vanous merged 1 commit into
open-stage:masterfrom
Light-oneNL:fix/wheelslot-empty-mediafilename

Conversation

@Light-oneNL

Copy link
Copy Markdown
Contributor

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 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.

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.
@vanous
vanous merged commit fb7a7b5 into open-stage:master Jul 24, 2026
9 checks passed
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.

2 participants