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.listenT CP(143, factory)
File "/usr/lib/python2.5/site-packages/twisted/internet/
posixbase.py", line 467, in listenTCP
p.startListenin g()
File "/usr/lib/python2.5/site-packages/twisted/internet/tcp.py",
line 733, in startListening
raise CannotListenErr or, (self.interface , self.port, le)
twisted.interne t.error.CannotL istenError: 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=mainlo op)
File "/var/lib/python-support/python2.5/dbus/_dbus.py", line 107, in
__new__
bus = BusConnection._ _new__(subclass , bus_type, mainloop=mainlo op)
File "/var/lib/python-support/python2.5/dbus/bus.py", line 121, in
__new__
bus = cls._new_for_bu s(address_or_ty pe, mainloop=mainlo op)
dbus.exceptions .DBusException: org.freedesktop .DBus.Error.NoR eply: 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