Skip to content

Commit ef0c514

Browse files
committed
Document that bytes_strictness is ignored on Python 3.
Thi is done to better support programs compatible with both py2 and py3.
1 parent 1b17e85 commit ef0c514

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Doc/bytes_mode.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ Errors, warnings, and automatic encoding
6565
----------------------------------------
6666

6767
While the type of values *returned* from python-ldap is always given by
68-
``bytes_mode``, the behavior for “wrong-type” values *passed in* can be
69-
controlled by the ``bytes_strictness`` argument to :func:`ldap.initialize`:
68+
``bytes_mode``, for Python 2 the behavior for “wrong-type” values *passed in*
69+
can be controlled by the ``bytes_strictness`` argument to
70+
:func:`ldap.initialize`:
7071

7172
``bytes_strictness='error'`` (default if ``bytes_mode`` is specified):
7273
A ``TypeError`` is raised.
@@ -82,6 +83,9 @@ controlled by the ``bytes_strictness`` argument to :func:`ldap.initialize`:
8283
``bytes_strictness='silent'``:
8384
The value is automatically encoded/decoded using the UTF-8 encoding.
8485

86+
On Python 3, ``bytes_strictness`` is ignored and a ``TypeError`` is always
87+
raised.
88+
8589
When setting ``bytes_strictness``, an explicit value for ``bytes_mode`` needs
8690
to be given as well.
8791

0 commit comments

Comments
 (0)