After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 640192 - Error creating a Gio.Settings object through py gobject introspection
Error creating a Gio.Settings object through py gobject introspection
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gsettings
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Allison Karlitskaya (desrt)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-01-21 15:19 UTC by Javier Hernández
Modified: 2011-01-28 01:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Javier Hernández 2011-01-21 15:19:55 UTC
I'm doing like this:

from gi.repository.Gio import Settings as GSettings
g_settings = GSettings()

... and I get a wonderful 'Segmentation Fault'

but, if i do like this:

g_settings = GSettings(scheme = 'yeah!')

No problem and i can work with g_settings scheme like a charm!

Regards!
Comment 1 Tomeu Vizoso 2011-01-21 15:26:06 UTC
Relevant traceback which explains why this is filed in glib/gsettings and not in pygobject/introspection:

  • #0 gvdb_table_lookup
    at gvdb/gvdb-reader.c line 258
  • #1 gvdb_table_get_table
    at gvdb/gvdb-reader.c line 509
  • #2 g_settings_schema_new
    at gsettingsschema.c line 276
  • #3 g_settings_constructed
    at gsettings.c line 478
  • #4 g_object_newv
    at gobject.c line 1507
  • #5 pygobject_constructv
    at gobjectmodule.c line 2257
  • #6 pygobject_init

Comment 2 Johan (not receiving bugmail) Dahlin 2011-01-21 15:36:41 UTC
In C-speak:

   g_object_new(G_TYPE_SETTINGS, NULL);

Should be enough to create the crash, while

   g_object_new(G_TYPE_SETTINGS, "scheme", "foobar", NULL);

Should be enough to avoid it.
Comment 3 Christian Persch 2011-01-21 17:04:39 UTC
Well, yes, gsettings with NULL schemas don't work. I guess adding a 

if (settings->priv->schema_name == NULL)
  g_error (...)

before g_settings_schema_new() would make it clearer that it's a programmer's error.