Bug #5298
closedTypeError: __str__ returned non-string (type NoneType)
100%
Description
Reported by user here: https://saxonica.plan.io/boards/4/topics/8476
The property PyXdmItem.head fails to return the underlying PyXdmMap object and throws the following error:
Traceback (most recent call last):
File "C:\Users\marti\OneDrive\Documents\xslt\blog-xslt-3-by-example\saxonc-11.1-python\arrays-and-maps\returnXdmMapFromXsltTest1.py", line 48, in <module>
print(result1)
TypeError: __str__ returned non-string (type NoneType)
Updated by O'Neil Delpratt almost 3 years ago
The Underlying C++ API for XPathProcessor is wrong. We check for instance of XdmFunctionItem before checking the subclasses first: i.e. XdmMap and XdmArray. The XQueryProcessor has the correct logic.
I have fixed this in the C++ code. Now investigating the failure of the toString
method
Updated by O'Neil Delpratt almost 3 years ago
The _ str _ on the XdmMap calls the C++ method getStringValue()
which is the same as applying the XPath string() function. This is undefined for an XdmMap. I have made a change for the _ str _ property to call toString() method which would be more useful
Updated by O'Neil Delpratt almost 3 years ago
- Status changed from New to Resolved
Bug fixed and available for maintenance release.
Updated by Debbie Lockett almost 3 years ago
- Status changed from Resolved to Closed
- Fixed in version set to 11.2
Bug fix applied in the Saxon 11.2 maintenance release.
Please register to edit this issue