Skip to content
Snippets Groups Projects
Commit 1519c3e6 authored by Michael Fladischer's avatar Michael Fladischer :speech_balloon:
Browse files

New upstream version 3.4.4

parent c84360e5
No related branches found
No related tags found
No related merge requests found
Released 3.4.4 2022-11-17
Fixes:
* Reconnect race condition in ReconnectLDAPObject is now fixed
* Socket ownership is now claimed once we've passed it to libldap
* LDAP_set_option string formats are now compatible with Python 3.12
Doc/
* Security Policy was created
* Broken article links are fixed now
* Bring Conscious Language improvements
Infrastructure:
* Add testing and document support for Python 3.10, 3.11, and 3.12
----------------------------------------------------------------
Released 3.4.3 2022-09-15
This is a minor release to bring back the removed OPT_X_TLS option.
......
......@@ -50,8 +50,8 @@ templates_path = ['.templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# The root toctree document.
root_doc = 'index'
# General substitutions.
project = 'python-ldap'
......
......@@ -13,7 +13,7 @@ Project
**A3**: see file CHANGES in source distribution
or `repository`_.
.. _repository: https://github.com/python-ldap/python-ldap/blob/master/CHANGES
.. _repository: https://github.com/python-ldap/python-ldap/blob/main/CHANGES
Usage
......
......@@ -8,13 +8,13 @@ members. Therefore some information might be outdated or links might be broken.
*Python LDAP Applications* articles by Matt Butcher
---------------------------------------------------
* `Part 1 - Installing and Configuring the Python-LDAP Library and Binding to an LDAP Directory <https://www.packtpub.com/article/installing-and-configuring-the-python-ldap-library-and-binding-to-an-ldap-directory>`_
* `Part 1 - Installing and Configuring the Python-LDAP Library and Binding to an LDAP Directory <https://hub.packtpub.com/python-ldap-applications-part-1-installing-and-configuring-python-ldap-library-and-bin/>`_
This also covers SASL.
* `Part 2 - LDAP Operations <https://www.packtpub.com/article/python-ldap-applications-ldap-opearations>`_
* `Part 3 - More LDAP Operations and the LDAP URL Library <https://www.packtpub.com/article/python-ldap-applications-more-ldap-operations-and-the-ldap-url-library>`_
* `Part 4 - LDAP Schema <https://www.packtpub.com/article/python-ldap-applications-ldap-schema>`_
* `Part 2 - LDAP Operations <https://hub.packtpub.com/configuring-and-securing-python-ldap-applications-part-2/>`_
* `Part 3 - More LDAP Operations and the LDAP URL Library <https://hub.packtpub.com/python-ldap-applications-extra-ldap-operations-and-ldap-url-library/>`_
* `Part 4 - LDAP Schema <https://hub.packtpub.com/python-ldap-applications-part-4-ldap-schema/>`_
Gee, someone waded through the badly documented mysteries of module
:mod:`ldap.schema`.
......
......@@ -893,7 +893,7 @@ class ReconnectLDAPObject(SimpleLDAPObject):
self._reconnect_lock = ldap.LDAPLock(desc='reconnect lock within %s' % (repr(self)))
# XXX cannot pickle file, use default trace file
self._trace_file = ldap._trace_file
self.reconnect(self._uri)
self.reconnect(self._uri,force=True)
def _store_last_bind(self,_method,*args,**kwargs):
self._last_bind = (_method,args,kwargs)
......@@ -914,11 +914,16 @@ class ReconnectLDAPObject(SimpleLDAPObject):
def passwd_s(self,*args,**kwargs):
return self._apply_method_s(SimpleLDAPObject.passwd_s,*args,**kwargs)
def reconnect(self,uri,retry_max=1,retry_delay=60.0):
def reconnect(self,uri,retry_max=1,retry_delay=60.0,force=True):
# Drop and clean up old connection completely
# Reconnect
self._reconnect_lock.acquire()
try:
if hasattr(self,'_l'):
if force:
SimpleLDAPObject.unbind_s(self)
else:
return
reconnect_counter = retry_max
while reconnect_counter:
counter_text = '%d. (of %d)' % (retry_max-reconnect_counter+1,retry_max)
......@@ -962,14 +967,12 @@ class ReconnectLDAPObject(SimpleLDAPObject):
return # reconnect()
def _apply_method_s(self,func,*args,**kwargs):
if not hasattr(self,'_l'):
self.reconnect(self._uri,retry_max=self._retry_max,retry_delay=self._retry_delay)
self.reconnect(self._uri,retry_max=self._retry_max,retry_delay=self._retry_delay,force=False)
try:
return func(self,*args,**kwargs)
except ldap.SERVER_DOWN:
SimpleLDAPObject.unbind_s(self)
# Try to reconnect
self.reconnect(self._uri,retry_max=self._retry_max,retry_delay=self._retry_delay)
self.reconnect(self._uri,retry_max=self._retry_max,retry_delay=self._retry_delay,force=True)
# Re-try last operation
return func(self,*args,**kwargs)
......
"""
meta attributes for packaging which does not import any dependencies
"""
__version__ = '3.4.3'
__version__ = '3.4.4'
__author__ = 'python-ldap project'
__license__ = 'Python style'
......@@ -4,7 +4,7 @@ ldapurl - handling of LDAP URLs as described in RFC 4516
See https://www.python-ldap.org/ for details.
"""
__version__ = '3.4.3'
__version__ = '3.4.4'
__all__ = [
# constants
......
......@@ -3,7 +3,7 @@ ldif - generate and parse LDIF data (see RFC 2849)
See https://www.python-ldap.org/ for details.
"""
__version__ = '3.4.3'
__version__ = '3.4.4'
__all__ = [
# constants
......
Metadata-Version: 2.1
Name: python-ldap
Version: 3.4.3
Version: 3.4.4
Summary: Python modules for implementing LDAP clients
Home-page: https://www.python-ldap.org/
Download-URL: https://pypi.org/project/python-ldap/
Author: python-ldap project
Author-email: python-ldap@python.org
License: Python style
Download-URL: https://pypi.org/project/python-ldap/
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
......@@ -22,6 +21,9 @@ Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Database
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Python Modules
......@@ -29,6 +31,8 @@ Classifier: Topic :: System :: Systems Administration :: Authentication/Director
Classifier: License :: OSI Approved :: Python Software Foundation License
Requires-Python: >=3.6
License-File: LICENCE
Requires-Dist: pyasn1>=0.3.7
Requires-Dist: pyasn1_modules>=0.1.5
python-ldap:
python-ldap provides an object-oriented API to access LDAP directory servers
......@@ -37,4 +41,3 @@ python-ldap:
(e.g. processing LDIF, LDAPURLs, LDAPv3 schema, LDAPv3 extended operations
and controls, etc.).
......@@ -4,7 +4,7 @@ slapdtest - module for spawning test instances of OpenLDAP's slapd server
See https://www.python-ldap.org/ for details.
"""
__version__ = '3.4.3'
__version__ = '3.4.4'
from slapdtest._slapdtest import SlapdObject, SlapdTestCase, SysLogHandler
from slapdtest._slapdtest import requires_ldapi, requires_sasl, requires_tls
......
......@@ -207,8 +207,8 @@ LDAP_set_option(LDAPObject *self, int option, PyObject *value)
}
else {
PyErr_Format(PyExc_ValueError,
"timeout must be >= 0 or -1/None for infinity, got %f",
doubleval);
"timeout must be >= 0 or -1/None for infinity, got %S",
value);
return 0;
}
break;
......
Metadata-Version: 2.1
Name: python-ldap
Version: 3.4.3
Version: 3.4.4
Summary: Python modules for implementing LDAP clients
Home-page: https://www.python-ldap.org/
Download-URL: https://pypi.org/project/python-ldap/
Author: python-ldap project
Author-email: python-ldap@python.org
License: Python style
Download-URL: https://pypi.org/project/python-ldap/
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
......@@ -22,6 +21,9 @@ Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Database
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Python Modules
......@@ -29,6 +31,8 @@ Classifier: Topic :: System :: Systems Administration :: Authentication/Director
Classifier: License :: OSI Approved :: Python Software Foundation License
Requires-Python: >=3.6
License-File: LICENCE
Requires-Dist: pyasn1>=0.3.7
Requires-Dist: pyasn1_modules>=0.1.5
python-ldap:
python-ldap provides an object-oriented API to access LDAP directory servers
......@@ -37,4 +41,3 @@ python-ldap:
(e.g. processing LDIF, LDAPURLs, LDAPv3 schema, LDAPv3 extended operations
and controls, etc.).
......@@ -647,24 +647,14 @@ class Test01_ReconnectLDAPObject(Test00_SimpleLDAPObject):
@requires_init_fd()
class Test03_SimpleLDAPObjectWithFileno(Test00_SimpleLDAPObject):
def _open_ldap_conn(self, who=None, cred=None, **kwargs):
if hasattr(self, '_sock'):
raise RuntimeError("socket already connected")
self._sock = socket.create_connection(
sock = socket.create_connection(
(self.server.hostname, self.server.port)
)
return super()._open_ldap_conn(
who=who, cred=cred, fileno=self._sock.fileno(), **kwargs
result = super()._open_ldap_conn(
who=who, cred=cred, fileno=sock.fileno(), **kwargs
)
def tearDown(self):
self._sock.close()
delattr(self, '_sock')
super().tearDown()
def reset_connection(self):
self._sock.close()
delattr(self, '_sock')
super(Test03_SimpleLDAPObjectWithFileno, self).reset_connection()
sock.detach()
return result
if __name__ == '__main__':
......
......@@ -90,6 +90,9 @@ setup(
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
# Note: when updating Python versions, also change tox.ini and .github/workflows/*
'Topic :: Database',
......
......@@ -5,7 +5,7 @@
[tox]
# Note: when updating Python versions, also change setup.py and .github/worlflows/*
envlist = py{36,37,38,39,310},c90-py{36,37},py3-nosasltls,doc,py3-trace,pypy3
envlist = py{36,37,38,39,310,311,312},c90-py{36,37},py3-nosasltls,doc,py3-trace,pypy3.9
minver = 1.8
[gh-actions]
......@@ -14,7 +14,10 @@ python =
3.7: py37
3.8: py38, doc, py3-nosasltls
3.9: py39, py3-trace
pypy3: pypy3
3.10: py310
3.11: py311
3.12: py312
pypy3.9: pypy3.9
[testenv]
deps =
......@@ -26,6 +29,11 @@ setenv =
commands = {envpython} -bb -Werror \
-m unittest discover -v -s Tests -p 't_*' {posargs}
[testenv:py312]
# Python 3.12 headers are incompatible with declaration-after-statement
setenv =
CFLAGS=-Wno-int-in-bool-context -Werror -std=c99
[testenv:py3-nosasltls]
basepython = python3
# don't install, install dependencies manually
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment