[Bug 989819] Re: the signatures match code should probably consider the exception for python errors

Martin Pitt martin.pitt at ubuntu.com
Wed Mar 16 16:37:46 UTC 2016


Due to the nature of Python exceptions this indeed can only ever be a
heuristic. Some Python errors are already very specific, and we *don't*
want their message be part of the signature. For example, we want to
treat PermissionError('/home/fred/foo') and
PermissionError('/home/joe/bar') as one and the same bug. Likewise, in
the example in the description we would want
"org.freedesktop.Accounts.Error.Failed: 'bg_BG.UTF-8' is not a valid
locale name" to be treated exactly the same as any other locale name.
Exception messages also often have localized or otherwise user/system
specific context in them.

For DBusError the situation is still relatively easy -- this is a well-
known one from dbus-python which actually wraps a "real" exception on
the server. For the duplicate signature we certainly should unwrap that
inner exception, so that we end up with something like
"DBusException:org.freedesktop.Accounts.Error.PermissionDenied".

The other case of pyapt's SystemErrors are harder to dissect as there is
no structure in the exceptions and their messages. So the only real
options that we have are to keep the status quo (don't use the message
at all) or take it wholesale. But I  think the latter wouldn't be
helpful as it would consider too many things as "not the same bug". One
could go further and just take the last word, but I think that would be
completely arbitrary and still not help (translations/not capturing the
important part).

So I propose to do one step at a time and unwrap DBusExceptions for now.

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

Title:
  the signatures match code should probably consider the exception for
  python errors

Status in Daisy:
  Confirmed
Status in apport package in Ubuntu:
  Triaged

Bug description:
  Looking through some db bug examples and saw some incorrect bug
  associations, one example

  "Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 62, in wrapper
      res = f(*args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 74, in wrapper
      res = f(*args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 1090, in on_combobox_locale_chooser_changed
      self.writeUserFormats()
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 775, in writeUserFormats
      self.writeUserFormatsSetting(userFormats=code)
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/LanguageSelector.py", line 71, in writeUserFormatsSetting
      iface.SetFormatsLocale(macr['SYSLOCALE'])
    File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
      return self._proxy_method(*args, **keywords)
    File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
      **keywords)
    File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
      message, timeout)
  DBusException: org.freedesktop.Accounts.Error.PermissionDenied: Not authorized"

  has been associated to
  https://bugs.launchpad.net/ubuntu/+source/accountsservice/+bug/930785

  "Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 62, in wrapper
      res = f(*args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 74, in wrapper
      res = f(*args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 1081, in on_combobox_locale_chooser_changed
      self.writeUserFormats()
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 775, in writeUserFormats
      self.writeUserFormatsSetting(userFormats=code)
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/LanguageSelector.py", line 71, in writeUserFormatsSetting
      iface.SetFormatsLocale(macr['SYSLOCALE'])
    File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
      return self._proxy_method(*args, **keywords)
    File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
      **keywords)
    File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
      message, timeout)
  DBusException: org.freedesktop.Accounts.Error.Failed: 'bg_BG.UTF-8' is not a valid locale name"

  
  The "functions signature" is the same, the exceptions are different though, it should probably consider that as part of the signature

To manage notifications about this bug go to:
https://bugs.launchpad.net/daisy/+bug/989819/+subscriptions



More information about the foundations-bugs mailing list