-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
It appears that xValue in this context can be a str or list containing a str. This means a str may be passed in self.nsmap.qname(qn) which causes the below exception.
ixbrl-viewer/iXBRLViewerPlugin/iXBRLViewer.py
Lines 267 to 275 in ebdc9d6
| elif f.concept is not None and f.concept.isEnumeration: | |
| qnEnums = f.xValue | |
| if qnEnums is None: | |
| factData["v"] = f.value | |
| factData["err"] = 'INVALID_IX_VALUE' | |
| else: | |
| if not isinstance(qnEnums, list): | |
| qnEnums = (qnEnums,) | |
| factData["v"] = " ".join(self.nsmap.qname(qn) for qn in qnEnums) |
'str' object has no attribute 'namespaceURI'
File "/usr/local/lib/python3.12/site-packages/iXBRLViewerPlugin/iXBRLViewer.py", in createViewer
self.addFact(report, f)
File "/usr/local/lib/python3.12/site-packages/iXBRLViewerPlugin/iXBRLViewer.py", in addFact
factData["v"] = " ".join(self.nsmap.qname(qn) for qn in qnEnums)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/iXBRLViewerPlugin/iXBRLViewer.py", in <genexpr>
factData["v"] = " ".join(self.nsmap.qname(qn) for qn in qnEnums)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/iXBRLViewerPlugin/iXBRLViewer.py", in qname
return "%s:%s" % (self.getPrefix(qname.namespaceURI, qname.prefix), qname.localName)
^^^^^^^^^^^^^^^^^^
A similar issue was recently handled in a recent PR. It currently relies on the assumption that xValue is either None (if the value is missing or invalid) or it is a QName or list[QName]. We apparently also need to handle cases where xValue is str or list[str].
Version
1.4.17
With which browsers are you experiencing the bug?
Firefox, Chrome, Safari, Microsoft Edge
Documents
No response
Screenshots
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working