A problem of twisted and dbus

huisan.wang at gmail.com huisan.wang at gmail.com
Wed Jan 2 20:15:06 EST 2008


Hello everyone,

I am writing a program with twisted and dbus and got a such problem.

If i run the code as
$python local_proxy.py
There is an error like this:
Traceback (most recent call last):
  File "local_proxy.py", line 608, in <module>
    reactor.listenTCP(143, factory)
  File "/usr/lib/python2.5/site-packages/twisted/internet/
posixbase.py", line 467, in listenTCP
    p.startListening()
  File "/usr/lib/python2.5/site-packages/twisted/internet/tcp.py",
line 733, in startListening
    raise CannotListenError, (self.interface, self.port, le)
twisted.internet.error.CannotListenError: Couldn't listen on any:143:
(13, 'Permission denied').

So I tried to run the program as $sudo python local_proxy.py
I got another error:
Traceback (most recent call last):
  File "local_proxy.py", line 625, in <module>
    session_bus = dbus.SessionBus()
  File "/var/lib/python-support/python2.5/dbus/_dbus.py", line 218, in
__new__
    mainloop=mainloop)
  File "/var/lib/python-support/python2.5/dbus/_dbus.py", line 107, in
__new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/var/lib/python-support/python2.5/dbus/bus.py", line 121, in
__new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did
not receive a reply. Possible causes include: the remote application
did not send a reply, the message bus security policy blocked the
reply, the reply timeout expired, or the network connection was
broken.

$sudo python local_porxy.py worked fine before I added the dbus into
the program. And dbus has no problem for my other programs.
How can I figure out this problem? Any helps will be appreciated.

-Huisan



More information about the Python-list mailing list