[python-ldap] Patch for ReconnectLDAPObject

Jonathan Giannuzzi jonathan at giannuzzi.be
Fri Aug 30 20:10:28 CEST 2013


Michael Ströder wrote:

> Jonathan Giannuzzi wrote:
>> Dylan Jay wrote:
>>> This patch seems to work really well. Any chance of getting it included in a release?
>> 
>> What is your view on this patch?
> 
> It's on my to-do list to carefully look at it. Maybe during the next days...
> 
>> Are there any specific issues preventing it from getting merged?
> 
> Hmm, in former times there were Python installations built without threading
> support. So I'm a bit cautious regarding backward compability.

I was using dummy_threading as a fallback for Python installations built without threading, which was introduced in Python 2.3.
On top of that, I was using the PEP8-compliant API (thus no camelCase) which was introduced in Python 2.6.

In order to be more compatible, I changed the patch to use a dummy condition instead of dummy_threading (similar to DummyLock in ldap/__init__.py)
I also changed it to use the camelCase threading API.

AFAIK, it should work against Python >= 1.5.1, with or without threads.
I tested it against Python 2.5 (threads), 2.6 (threads and no threads) and 2.7 (threads and no threads).
Unfortunately I don't have easy access to older installations of Python.

Best regards,
Jonathan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldapobject_threadsafe_compatible.diff
Type: application/octet-stream
Size: 7145 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20130830/364d67cd/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4145 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20130830/364d67cd/attachment.bin>


More information about the python-ldap mailing list