[python3-ldap] Python3-ldap 0.9.2 is released

python3ldap python3ldap at gmail.com
Sat Apr 26 22:59:26 CEST 2014


Hello everybody,
version 0.9.2 of python3-ldap is out. There is a new feature in this
release and a number of fixes and improvements.

- The new feature is the ReusableThreaded strategy. This asynchronous
strategy let you to create a pool of connection to one or more ldap
servers and access them through a multi-threaded connection pool. It's
similar to ldappool but it should be easier to use because you jsut
define a single Connection with this strategy and it creates under the
hood a pool of lazy Restartable connections, each with its own running
thread that connects to the servers defined in the ServerPool of the
connection object. You must pass a pool_name while creating this kind
of connection. The pool_name defines a "singleton" pool of connections
that can be accessed through the connection itself or via any other
ReusableThreaded connection that use the same pool_name. You can pass
a pool_size (default is 10) and a pool_lifetime (default is 3600 (1
hour) that refresh each connection when the lifetime is expired,
together with the pool_name. To close the connection pool you must use
the connection.strategy.terminale() method.
The ReusableThreaded strategy should be used in long standing
application server but keep in mind that this is a first release of
this strategy and the code is not really well tested in production.
Please let me know.if you are interested or have suggestion on how to
improve this strategy.

- I've made the difference between the response and the result
attributes more clear. Now in all strategies result contains the
result message of the ldap operation requested while response contains
any other message sent back by the server. Previously this was true
only for the search operation, while now all operations have the same
behaviour.

- When using an async strategy the get_response(id) method now returns
two values, the response and the result. This is needed to avoid
problems when using threaded connections.

- All operation now are more consistent with the RFC4515 regarding to
binary data value. RFC4515 specify that binary data hex must be
escaped with a backslash as in \01\02\03\0FF. You can now pass this
format directly in the attribute values with adding, modifying or
comparing operation and in the search filter for search operation.
There is a convenience function to convert a bytes object to this
escape format: escape_bytes(bytes_value) in the new ldap.utils.conv
namespace.

This is the full changelog for 0.9.2:

    - changed return value in get_response from response to (response,
result) - helpful for multi threaded connections
    - added ReusableStrategy for pooling connections
    - refined docstrings (thanks to Will)
    - result and response attributes don't overlap anymore. Operation
result is only in result attribute.
    - fixed search for binary values (thanks to Marcin)
    - added convenience function to convert bytes to LDAP binary value
string format for search filter


Have fun.
gc


More information about the python3-ldap mailing list