Gio.Settings.new() on missing schema causes Trace/breakpoint trap
On glib-2.64.5 with this Python:
#!/usr/bin/python3
import gi
gi.require_version('Gio', '2.0')
from gi.repository import Gio
settings = Gio.Settings.new("no.such.schema")
print("OK")
Gio.Settings.new() causes an immediate exit:
GLib-GIO-ERROR **: Settings schema 'no.such.schema' is not installed
Trace/breakpoint trap
It would be great if this could instead cause a Python exception that could be caught.
Currently working around by first testing with:
source = Gio.SettingsSchemaSource.get_default()
schema = source.lookup("no.such.schema", False)
if schema is None:
print("None")