Merge lp:~rodrigo-moya/ubuntuone-client/fix-deprecation-warning into lp:ubuntuone-client

Proposed by dobey
Status: Merged
Approved by: Rick McBride
Approved revision: 40
Merged at revision: not available
Proposed branch: lp:~rodrigo-moya/ubuntuone-client/fix-deprecation-warning
Merge into: lp:ubuntuone-client
Diff against target: None lines
To merge this branch: bzr merge lp:~rodrigo-moya/ubuntuone-client/fix-deprecation-warning
Reviewer Review Type Date Requested Status
Rick McBride (community) Approve
dobey (community) Approve
Review via email: mp+7286@code.launchpad.net

This proposal supersedes a proposal from 2009-06-10.

Commit message

[r=dobey,rmcbride] Use correct method for getting DBusException's message

To post a comment you must log in.
Revision history for this message
Rodrigo Moya (rodrigo-moya) wrote : Posted in a previous version of this proposal

User was getting the warning dobey's previous branch was supposed to fix, but looking at code examples (no API docs I've found talk about error_handler signature) like http://paste.frubar.net/8211 shows dbus sends an *args argument to that function.

Revision history for this message
Rick McBride (rmcbride) wrote : Posted in a previous version of this proposal

Looks good!

review: Approve
Revision history for this message
Eric Casteleijn (thisfred) wrote : Posted in a previous version of this proposal

Looks good, and all tests pass, even though I get an error (traceback below) at the beginning of python setup.py check. I assume that's some missing dependency on my system. (setup.py build already complained about icontool, and when that was installed inkscape.) None of that is related to your change of course, just recording for posterity...

Traceback (most recent call last):
  File "/usr/bin/pylint", line 4, in <module>
    lint.Run(sys.argv[1:])
  File "/usr/lib/python2.6/dist-packages/pylint/lint.py", line 851, in __init__
    linter.check(args)
  File "/usr/lib/python2.6/dist-packages/pylint/lint.py", line 476, in check
    self.check_astng_module(astng, checkers)
  File "/usr/lib/python2.6/dist-packages/pylint/lint.py", line 553, in check_astng_module
    if implements(checker, IASTNGChecker)])
  File "/usr/lib/python2.6/dist-packages/pylint/lint.py", line 570, in astng_events
    self.astng_events(child, checkers, _reversed_checkers)
  File "/usr/lib/python2.6/dist-packages/pylint/lint.py", line 570, in astng_events
    self.astng_events(child, checkers, _reversed_checkers)
  File "/usr/lib/python2.6/dist-packages/pylint/lint.py", line 570, in astng_events
    self.astng_events(child, checkers, _reversed_checkers)
  File "/usr/lib/python2.6/dist-packages/pylint/lint.py", line 570, in astng_events
    self.astng_events(child, checkers, _reversed_checkers)
  File "/usr/lib/python2.6/dist-packages/pylint/lint.py", line 567, in astng_events
    checker.visit(astng)
  File "/usr/lib/python2.6/dist-packages/logilab/astng/utils.py", line 85, in visit
    method(node)
  File "/usr/lib/python2.6/dist-packages/pylint/checkers/imports.py", line 261, in visit_from
    fullname = get_module_part(fullname,context_file=node.root().file)
  File "/usr/lib/python2.6/dist-packages/logilab/common/modutils.py", line 300, in get_module_part
    path=path, context_file=context_file)
  File "/usr/lib/python2.6/dist-packages/logilab/common/modutils.py", line 244, in file_from_modpath
    return _file_from_modpath(modpath, path, context)
  File "/usr/lib/python2.6/dist-packages/logilab/common/modutils.py", line 515, in _file_from_modpath
    mtype, mp_filename = _module_file(modpath, path)
  File "/usr/lib/python2.6/dist-packages/logilab/common/modutils.py", line 548, in _module_file
    _, mp_filename, mp_desc = find_module(modpath[0], path)
ImportError: No module named nautilus

review: Approve
Revision history for this message
dobey (dobey) wrote : Posted in a previous version of this proposal

I'm not sure about this. DBus itself doesn't pass *args. It passes a DBusError, although it looks like for some reason it's ending up as a BaseException instead. The *args thing is python magic, and so I think this will still fail, but with the problem of trying to stick a BaseException where a string is expected, rather than the DeprecationWarning about BaseException.message. What we need here, is the DBusError.message to go to the log.

review: Abstain
Revision history for this message
dobey (dobey) wrote : Posted in a previous version of this proposal

> Looks good, and all tests pass, even though I get an error (traceback below)
> at the beginning of python setup.py check. I assume that's some missing
> dependency on my system. (setup.py build already complained about icontool,
> and when that was installed inkscape.) None of that is related to your change
> of course, just recording for posterity...
>
> ImportError: No module named nautilus

This is an issue with the way the nautilus python module works. It is only loadable from within nautilus itself, and otherwise is not usable. I don't know why exactly it's trying to load it and failing, rather than loading the stub APIs we've defined to get around such problems though. But this will also be gone in due course, as the nautilus extension is being ported to C.

Revision history for this message
dobey (dobey) wrote : Posted in a previous version of this proposal

As per our discussion on IRC, I'm reviewing needs-fixing, and changing the overall status. When you've pushed an updated branch to use .get_dbus_message() instead, please change the proposal status to "Resubmit" to create a new proposal, with the updated diff. You also don't need to use *args, as error handler only ever gets one argument. Continuing to use error as the only argument here is fine.

review: Needs Fixing
Revision history for this message
Rodrigo Moya (rodrigo-moya) wrote : Posted in a previous version of this proposal

Code changed to use get_dbus_message() and changed status

review: Needs Resubmitting
Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Rick McBride (rmcbride) wrote :

looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/ubuntuone-client-applet'
2--- bin/ubuntuone-client-applet 2009-06-04 15:17:19 +0000
3+++ bin/ubuntuone-client-applet 2009-06-10 13:58:11 +0000
4@@ -60,7 +60,7 @@
5
6 def dbus_error(error):
7 """Got an error from DBus."""
8- logger.debug("DBusError: %s" % error.message)
9+ logger.debug("DBusError: %s" % error.get_dbus_message())
10
11 def dbus_async(*args):
12 """Simple handler to make dbus do stuff async."""

Subscribers

People subscribed via source and target branches