Skip to content

Commit

Permalink
Doc: LDAPBytesWarning doc improvements
Browse files Browse the repository at this point in the history
- Make filtering note apply to both causes of the warning
- Add formal class documentation
- Add cross-references
  • Loading branch information
Petr Viktorin committed Dec 7, 2017
1 parent 4389d9b commit 8290270
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Doc/bytes_mode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ Unspecified: relaxed mode with warnings

Text values returned from python-ldap are always ``unicode``.
Text values supplied to python-ldap should be ``unicode``;
warnings of type :class:`ldap.LDAPBytesWarning` are emitted when they
are not. :class:`ldap.LDAPBytesWarning` is a subclass of
:class:`BytesWarning`.
warnings are emitted when they are not.

The warnings are of type :class:`~ldap.LDAPBytesWarning`, which
is a subclass of :class:`BytesWarning` designed to be easily
:ref:`filtered out <filter-bytes-warning>` if needed.

Backwards-compatible behavior is not scheduled for removal until Python 2
itself reaches end of life.
Expand Down Expand Up @@ -107,8 +109,10 @@ Note that only the result's *values* are of the ``bytes`` type:
]
Filter warning
--------------
.. _filter-bytes-warning:

Filtering warnings
------------------

The bytes mode warnings can be filtered out and ignored with a
simple filter.
Expand Down
12 changes: 12 additions & 0 deletions Doc/reference/ldap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,18 @@ The above exceptions are raised when a result code from an underlying API
call does not indicate success.


Warnings
========

.. py:class:: LDAPBytesWarning
Raised when bytes/text mismatch in non-strict bytes mode.

See :ref:`bytes_mode` for details.

.. versionadded:: 3.0.0


.. _ldap-objects:

LDAPObject classes
Expand Down

0 comments on commit 8290270

Please sign in to comment.