Python-ldap set_option在优胜美地上不起作用 [英] Python-ldap set_option not working on Yosemite

查看:170
本文介绍了Python-ldap set_option在优胜美地上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已正确安装了python-ldap(2.4.19)模块,并成功执行了大部分操作. 但是,当我们尝试加载证书以使用ssl(ldaps)时,ldap.set_option总是返回异常.

We've installed the python-ldap(2.4.19) module without errors and perform most of the operations successfully. However ldap.set_option always returns a exception when we try to load certificates to use ssl (ldaps).

它发生在运行优胜美地的笔记本电脑上,但不在Mavericks或Linux上. (所有Macbook均安装了xcode)

It occurs on notebooks running Yosemite but not on Mavericks or Linux. (All Macbooks have xcode installed)

我们认为它应该是一些丢失/过时/更新的库,但我们不知道如何找到它.

We think it should be some missing/outdated/updated lib but we don't know how to find it.

有任何线索吗?

$python
Python 2.7.6 (default, Sep  9 2014, 15:04:36)
...
>>>import ldap
>>>ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, '/my_path/my_cert.crt')
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/*xxx*/python2.7/site-packages/ldap/functions.py", line 133, in set_option
   return _ldap_function_call(None,_ldap.set_option,option,invalue)
 File "/*xxx*/python2.7/site-packages/ldap/functions.py", line 64, in _ldap_function_call
   result = func(*args,**kwargs)
ValueError: option error

推荐答案

通过安装openldap解决了这个问题,然后手动下载了tarball,然后使用mod setup.cfg拾取了/usr/local,然后进行了安装.

got around this by installing openldap threw brew, and then manually downloading the tarball, and mod setup.cfg to pick up /usr/local, and then install.

http://sourceforge.net/p/python-ldap/bugs/65 /是将/usr/local添加到python-ldap的默认值的票据.

http://sourceforge.net/p/python-ldap/bugs/65/ is the ticket to add /usr/local to the defaults on python-ldap.

这篇关于Python-ldap set_option在优胜美地上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆