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 Desktop
Packages, which is subscribed to webapps-applications in Ubuntu.
https://bugs.launchpad.net/bugs/1206314

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

Status in “webapps-applications” package in Ubuntu:
  Confirmed

Bug description:
  o sitema não emula corretamente travando.

  ProblemType: Crash
  DistroRelease: Ubuntu 13.10
  Package: unity-webapps-common 2.4.16+13.10.20130719-0ubuntu1
  ProcVersionSignature: Ubuntu 3.10.0-6.17-generic 3.10.3
  Uname: Linux 3.10.0-6-generic x86_64
  NonfreeKernelModules: wl
  ApportVersion: 2.11-0ubuntu1
  Architecture: amd64
  Date: Mon Jul 29 21:29:14 2013
  ExecutablePath: 
/usr/share/session-migration/scripts/install-default-webapps-in-launcher.py
  InstallationDate: Installed on 2013-07-14 (15 days ago)
  InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Alpha amd64 (20130529)
  InterpreterPath: /usr/bin/python2.7
  MarkForUpload: True
  PackageArchitecture: all
  ProcCmdline: /usr/bin/python 
/usr/share/session-migration/scripts/install-default-webapps-in-launcher.py
  Signal: 5
  SourcePackage: webapps-applications
  StacktraceTop:
   g_settings_get_mapped () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
   ffi_call_unix64 () from /usr/lib/x86_64-linux-gnu/libffi.so.6
   ffi_call () from /usr/lib/x86_64-linux-gnu/libffi.so.6
   g_callable_info_invoke () from /usr/lib/libgirepository-1.0.so.1
   g_function_info_invoke () from /usr/lib/libgirepository-1.0.so.1
  Title: install-default-webapps-in-launcher.py crashed with signal 5 in 
g_settings_get_mapped()
  UpgradeStatus: No upgrade log present (probably fresh install)
  UserGroups:

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

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to