[wicd-curses]Unhandle expection in setup_dbus

Bug #937737 reported by Liu zhiyou
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
wicd
Fix Committed
Low
Unassigned

Bug Description

Hi,
    I have been using wicd and wicd-curses for almost one years in my Archlinux. It works great and helps me a lot. But I also find out that if I execute wicd-curses when wicd does not start, I got stuff like:

$ wicd-curses

Can't connect to the daemon, trying to start it automatically...
Traceback (most recent call last):
  File "/usr/share/wicd/curses/wicd-curses.py", line 1043, in <module>
    setup_dbus()
  File "/usr/share/wicd/curses/wicd-curses.py", line 1031, in setup_dbus
    dbus_ifaces = dbusmanager.get_dbus_ifaces()
  File "/usr/lib/python2.7/site-packages/wicd/dbusmanager.py", line 36, in get_dbus_ifaces
    return DBUS_MANAGER.get_dbus_ifaces()
  File "/usr/lib/python2.7/site-packages/wicd/dbusmanager.py", line 62, in get_dbus_ifaces
    if not self._dbus_ifaces: connect_to_dbus()
  File "/usr/lib/python2.7/site-packages/wicd/dbusmanager.py", line 48, in connect_to_dbus
    return DBUS_MANAGER.connect_to_dbus()
  File "/usr/lib/python2.7/site-packages/wicd/dbusmanager.py", line 79, in connect_to_dbus
    proxy_obj = self._bus.get_object("org.wicd.daemon", '/org/wicd/daemon')
  File "/usr/lib/python2.7/site-packages/dbus/bus.py", line 244, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 246, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python2.7/site-packages/dbus/bus.py", line 183, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python2.7/site-packages/dbus/bus.py", line 281, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/python2.7/site-packages/dbus/connection.py", line 630, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1

    It seems to be caused by missing setting of dbus. But I think wicd-curses should give some nice message in such cases. So I made a little modify in wicd-curses.py, and It will show like:

$ python2 -O wicd-curses.py

Can't connect to the daemon, trying to start it automatically...
Failed to start wicd automatically....Exit now.

    now.
    My patch is naive. Here is the result of diff. I havn't submit any patch before, so sorry for the poor format.

$ diff wicd-curses.py wicd-curses.py.old

1030,1038c1030,1034
< try:
< bus = dbusmanager.get_bus()
< dbus_ifaces = dbusmanager.get_dbus_ifaces()
< daemon = dbus_ifaces['daemon']
< wireless = dbus_ifaces['wireless']
< wired = dbus_ifaces['wired']
< except DBusException:
< print 'Failed to start wicd automatically....Exit now.'
< sys.exit(3)
---
> bus = dbusmanager.get_bus()
> dbus_ifaces = dbusmanager.get_dbus_ifaces()
> daemon = dbus_ifaces['daemon']
> wireless = dbus_ifaces['wireless']
> wired = dbus_ifaces['wired']

regards,
Liuzhiyou

Related branches

Changed in wicd:
status: New → Fix Committed
Changed in wicd:
importance: Undecided → Low
Changed in wicd:
milestone: none → 1.7.5
assignee: nobody → Tom Van Braeckel (tomvanbraeckel)
Changed in wicd:
milestone: 1.7.5 → 1.7.3
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.