D-Bus Python Bindings and Python 2.5

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Sep 22 03:16:27 PDT 2006


On Thu, 21 Sep 2006 at 17:33:32 -0400, Mystilleef wrote:
> Exception exceptions.AttributeError: "'exceptions.TypeError' object
> has no attribute '__module__'" in
> 'dbus_bindings._GIL_safe_cmessage_function_handler' ignored

Possible causes include: dbus-python is largely written in Pyrex, so
nobody quite knows what's going on :-) Also, the exception handling is a
bit precarious due to the large stack of Python code recursing into C
code recursing into Python code. It looks as though something (either
dbus-python or your code) is raising TypeError, and something (again,
either dbus-python or your code) is dealing with that in a now-buggy way.

I'm currently working on a rewrite in C which will address the first
issue, and hopefully also deal with exceptions better (at least a
partial stack trace, for a start). It may be that your app or the Python
parts of dbus-python are buggy under Python 2.5, but it'll at least be
easier to diagnose...

You may want to check that your app's signal handlers, exported
functions, etc. are not raising a TypeError (put a try/except round
things that are called on startup). Also, if you specifically look at
the __module__ attribute of caught exceptions, it appears that in Python 2.5
you can't do that (without wrapping it in a try/except AttributeError
anyway).

I'm not sure whether TypeError having lost its __module__ attribute in
Python 2.5 is an intentional decision by upstream - it's certainly a
change in behaviour.

	Simon


More information about the dbus mailing list