You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUG: jobInfo is falsey when it holds only child elements (with astropy/astropy#20509) #788
bool(job.jobinfo) is False for a jobInfo that holds only child elements when pyvo runs against astropy/astropy#20509, which we are hoping to get into astropy 8.1. The if job.jobinfo: pattern shown in docs/io/uws.rst then skips a populated jobInfo, and four doctest examples in that file fail. Once the astropy PR is merged, pyvo's devdeps CI job will pick it up from the nightly wheels and fail too.
Reproducer
Based on the failing doctest docs/io/uws.rst:239: DocTestFailure:
ExtensibleUWSElement gets its truthiness from ContentMixin.__bool__, which returns bool(self.content). content is set from the text that astropy.utils.xml.iterparser.get_xml_iterator gives with the element's end event.
Until now, astropy's XML parser never cleared its text buffer when an element ended, so every end event repeated the text of the last nested element. In the example above, </uws:jobInfo> carried compute-node-03, even though that text belongs only to the parent. That is why bool(job.jobinfo) was True, and also why .text and str() of an element with children return the text of its last child. The repeated text is what made reading large BINARY2 VOTables use so much memory (astropy/astropy#8946), so astropy/astropy#20509 removes it, and an element that holds only child elements now ends with empty text.
The .text and str() results with astropy/astropy#20509 look like the intended ones. Only the truthiness needs a change in pyvo. So perhaps give ExtensibleUWSElement its own __bool__ method that is true when the element has child elements or text, and make it not depend on the end-event text. That should work with astropy main and the PR.
changed the title [-]BUG: jobInfo is falsy when it holds only child elements (with astropy/astropy#20509)[/-][+]BUG: jobInfo is falsey when it holds only child elements (with astropy/astropy#20509)[/+]on Oct 14, 2026
Activity
[-]BUG: jobInfo is falsy when it holds only child elements (with astropy/astropy#20509)[/-][+]BUG: jobInfo is falsey when it holds only child elements (with astropy/astropy#20509)[/+]