Skip to content

Commit bb6452c

Browse files
committed
Make initialize() pass extra keyword arguments to LDAPObject
Fixes: #249
1 parent ec41070 commit bb6452c

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Doc/reference/ldap.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ This module defines the following functions:
6363
:py:const:`2` for logging the method calls with arguments and the complete results and
6464
:py:const:`9` for also logging the traceback of method calls.
6565

66+
Additional keyword arguments are passed to :class:`LDAPObject`.
67+
6668
.. seealso::
6769

6870
:rfc:`4516` - Lightweight Directory Access Protocol (LDAP): Uniform Resource Locator

Lib/ldap/functions.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ def _ldap_function_call(lock,func,*args,**kwargs):
6565
return result
6666

6767

68-
def initialize(uri,trace_level=0,trace_file=sys.stdout,trace_stack_limit=None, bytes_mode=None):
68+
def initialize(
69+
uri, trace_level=0, trace_file=sys.stdout, trace_stack_limit=None,
70+
bytes_mode=None, **kwargs
71+
):
6972
"""
7073
Return LDAPObject instance by opening LDAP connection to
7174
LDAP host specified by LDAP URL
@@ -81,8 +84,12 @@ def initialize(uri,trace_level=0,trace_file=sys.stdout,trace_stack_limit=None, b
8184
Default is to use stdout.
8285
bytes_mode
8386
Whether to enable :ref:`bytes_mode` for backwards compatibility under Py2.
87+
88+
Additional keyword arguments (such as ``bytes_strictness``) are
89+
passed to ``LDAPObject``.
8490
"""
85-
return LDAPObject(uri,trace_level,trace_file,trace_stack_limit,bytes_mode)
91+
return LDAPObject(
92+
uri, trace_level, trace_file, trace_stack_limit, bytes_mode, **kwargs)
8693

8794

8895
def get_option(option):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy