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