Skip to content

Allow passing None as uri argument to ldap.initialize() #465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Doc/reference/ldap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ This module defines the following functions:
The *uri* parameter may be a comma- or whitespace-separated list of URIs
containing only the schema, the host, and the port fields. Note that
when using multiple URIs you cannot determine to which URI your client
gets connected.
gets connected. If *uri* is :py:const:`None`, the default URIs from
``ldap.conf`` or :py:const:`OPT_URI` global option will be used.

If *fileno* parameter is given then the file descriptor will be used to
connect to an LDAP server. The *fileno* must either be a socket file
Expand Down
2 changes: 1 addition & 1 deletion Modules/functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ l_ldap_initialize(PyObject *unused, PyObject *args)
int ret;
PyThreadState *save;

if (!PyArg_ParseTuple(args, "s:initialize", &uri))
if (!PyArg_ParseTuple(args, "z:initialize", &uri))
return NULL;

save = PyEval_SaveThread();
Expand Down