Details
Description
Minimal example to replicate crash:
from PySide2.QtCore import QJsonDocument QJsonDocument.fromJson(b'{"test": null}').toVariant()
Which causes an immediate segfault.
For a hint at what may be going on, if you pass in a JSON document that contains an array with a null, rather than a null directly, like so:
from PySide2.QtCore import QJsonDocument QJsonDocument.fromJson(b'{"test": [null]}').toVariant()
Raises a Python exception, not a segfault:
Traceback (most recent call last): File "<stdin>", line 1, in <module> RuntimeError: Can't find converter for 'std::nullptr_t'.
So perhaps what needs to be done is the Variant converters need to handle the special case of turning null values into Py_None
Attachments
For Gerrit Dashboard: PYSIDE-854 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
245388,8 | Add std::nullptr_t support | 5.12 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
401878,3 | WIP: shiboken6: Test nullptr_t | dev | pyside/pyside-setup | Status: ABANDONED | -2 | 0 |
403840,3 | shiboken6: Test nullptr_t | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
415273,2 | shiboken6: Fix compile error in tests | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
416624,2 | shiboken6: Fix compile error in tests | 6.3 | pyside/pyside-setup | Status: MERGED | +2 | 0 |