Skip to content

Commit 8290270

Browse files
committed
Doc: LDAPBytesWarning doc improvements
- Make filtering note apply to both causes of the warning - Add formal class documentation - Add cross-references
1 parent 4389d9b commit 8290270

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

Doc/bytes_mode.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,11 @@ Unspecified: relaxed mode with warnings
6666

6767
Text values returned from python-ldap are always ``unicode``.
6868
Text values supplied to python-ldap should be ``unicode``;
69-
warnings of type :class:`ldap.LDAPBytesWarning` are emitted when they
70-
are not. :class:`ldap.LDAPBytesWarning` is a subclass of
71-
:class:`BytesWarning`.
69+
warnings are emitted when they are not.
70+
71+
The warnings are of type :class:`~ldap.LDAPBytesWarning`, which
72+
is a subclass of :class:`BytesWarning` designed to be easily
73+
:ref:`filtered out <filter-bytes-warning>` if needed.
7274

7375
Backwards-compatible behavior is not scheduled for removal until Python 2
7476
itself reaches end of life.
@@ -107,8 +109,10 @@ Note that only the result's *values* are of the ``bytes`` type:
107109
]
108110
109111
110-
Filter warning
111-
--------------
112+
.. _filter-bytes-warning:
113+
114+
Filtering warnings
115+
------------------
112116

113117
The bytes mode warnings can be filtered out and ignored with a
114118
simple filter.

Doc/reference/ldap.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,18 @@ The above exceptions are raised when a result code from an underlying API
564564
call does not indicate success.
565565

566566

567+
Warnings
568+
========
569+
570+
.. py:class:: LDAPBytesWarning
571+
572+
Raised when bytes/text mismatch in non-strict bytes mode.
573+
574+
See :ref:`bytes_mode` for details.
575+
576+
.. versionadded:: 3.0.0
577+
578+
567579
.. _ldap-objects:
568580

569581
LDAPObject classes

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