Python 2.2.1 C API - Error Handling

David Abrahams david.abrahams at
Tue Aug 20 02:07:09 CEST 2002

<cseymour at> wrote in message
news:kvwuqmtpsd.fsf at
> Hi,
> We have some extension modules that worked with Python 2.1, but now
> that we use Python 2.2.1 they crash whenever a PyErr is thrown.
> We're using Boost (couldn't get any help from their mailing list),

Never saw your posting. Try C++-sig at instead, though: that's more
Boost.Python specific

> with the usual Boost module setup, where there's a try for the module
> builder stuff, and a catch afterwards which runs
> Boost's handle_exception() function, which causes Python errors. In
> Python 2.1, whenever we throw an error, it is caught by this "catch(...)"
> clause, and an error is raised inside Python. In
> Python 2.2.1, the catch seems to be completely skipped and we get a seg
> fault. I have seen this same behaviour in multiple extension modules.

What is your compiler and platform? Did you switch compiler versions between
2.1 and 2.2.1?

           David Abrahams * Boost Consulting
dave at *

More information about the Python-list mailing list