So indeed, the script contains this code:

first_mapping = [True]
def mapping_callback(value, first_mapping):
    if not value:
        return (True, [])
    if first_mapping[0]:
        first_mapping[0] = False
        return (False, value)
    return (True, value)

def get_default_value_for(settings, key):
    return settings.get_mapped(UNITY_LAUNCHER_FAVORITE_KEY, mapping_callback, 
first_mapping)


Which looks like it's fine because of:

    if not value:
        return (True, [])

but for some reason, the python bindings are unable to deal with this.
Running the script gives warnings like so:

** (process:21913): WARNING **: (pygi-
argument.c:903):_pygi_argument_from_object: runtime check failed:
(transfer == GI_TRANSFER_NOTHING)

before crashing with the error from the previous comment.


An easier way of getting the default value of a key (and the one most commonly 
used by other developers) is this pattern:

1) create a GSettings object
2) .delay()
3) .reset('key')
4) .get('key')
5) free the object without calling .apply()

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1206314

Title:
  install-default-webapps-in-launcher.py crashed with signal 5 in
  g_settings_get_mapped()

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/webapps-applications/+bug/1206314/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to