I get the following error when run under root i.e. Sudo gainroot /home/user # python saera.py saera.py:186: SyntaxWarning: name 'able_to_listen' is used prior to global declaration global able_to_listen process 3305: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757. This is normally a bug in some application using the D-Bus library. process 3305: arguments to dbus_connection_set_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5721. This is normally a bug in some application using the D-Bus library. Aborted