python-ldap与python25以及CentOS 4.x

| | Comments (0) | TrackBacks (0)

最近写的一个东东要用python25和python-ldap,但是使用的那台主机是python23、ldap2.2.x和python-ldap2.0.1。安装了一个python25,python-ldap是2.3.8,编译失败,openldap2.2太老了,python-ldap2.3.8不向下兼容了。

那我就用python-ldap2.0.x,这个版本已经不提供下载了,从sf.net的cvs上拉了一份2.0.11的版本,这次倒是编过去了。用的时候出问题了

*** glibc detected *** free(): invalid pointer: 0xb7f60728 ***
Aborted

查来查去有三个文章有说这种情况

主要原因是PyMem_DEL的调用已经不被推荐了,应该用PyObject_Del。所以要对两个C文件做一些改动。

sed -i.orig 's/PyMem_DEL/PyObject_Del/g' Modules/LDAPObject.c 
sed -i.orig 's/PyMem_DEL/PyObject_Del/g' Modules/ldapcontrol.c 

然后再build,install就OK了

0 TrackBacks

Listed below are links to blogs that reference this entry: python-ldap与python25以及CentOS 4.x.

TrackBack URL for this entry: http://mt.khsing.net/cgi-bin/mt-tb.cgi/72

Leave a comment

About this Entry

This page contains a single entry by Guixing published on June 3, 2009 11:45 AM.

终端下的Spotlight was the previous entry in this blog.

切字符串 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.