[PyQt] SystemError raised in QSettings.value
Phil Thompson
phil at riverbankcomputing.com
Tue Jul 3 12:09:18 BST 2018
On 2 Jul 2018, at 4:21 pm, Ales Erjavec <ales.erjavec324 at gmail.com> wrote:
>
> Hi,
>
> The `QSetings.value` can raise a:
>
> SystemError: <built-in method value of QSettings object at
> 0x103d56ee8> returned
> a result with an error set
>
> This can happen if the stored value was a QVariantMap with complex
> (PyQt_PyObject?) stored values and the query `type` parameter is not
> `dict` or `"QVariantMap"`
>
> Example:
> ```
> from PyQt5.QtCore import QSettings
>
> s = QSettings("/dev/null", QSettings.IniFormat)
> s.setValue("value", {"a": ["a"]})
>
> print(s.value("value", defaultValue="", type=str))
> ```
>
> Tested with PyQt5 5.9.2 and 5.11.2
Should be fixed in tonight's snapshot.
Thanks,
Phil
More information about the PyQt
mailing list