python-ldap does not include Python.h first

Anthony Baxter anthony at
Tue Oct 28 08:26:54 CET 2003

python-ldap breaks the "Always include Python.h first" rule in it's
C files - see, e.g.

    The first line of our file can be:

    #include <Python.h>

    which pulls in the Python API (you can add a comment describing the
    purpose of the module and a copyright notice if you like). Since
    Python may define some pre-processor definitions which affect the
    standard headers on some systems, you must include Python.h before
    any standard headers are included.

At least on this Linux Redhat 9 system, this causes all sorts of 
horrible warnings to be emitted. Doing the right thing makes them 
go away. Patch attached.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 1260 bytes
Desc: Python.h-first-patch
URL: <>

More information about the python-ldap mailing list