cpython/Lib/logging
Miss Islington (bot) db63da7e5d
bpo-42644: Validate values in logging.disable() (GH-23786)
* bpo-42644: Validate values in logging.disable()

Technically make the value of manager a property that checks and convert
values assigned to it properly. This has the side effect of making
`logging.disable` also accept strings representing the various level of
warnings.

We want to validate the type of the disable attribute at assignment
time, as it is later compared to other levels when emitting warnings and
would generate a `TypeError: '>=' not supported between ....` in a
different part of the code base, which can make it difficult to track
down.

When assigned an incorrect value; it will raise a TypeError when the
wrong type, or ValueError if an invalid str.

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
(cherry picked from commit b32d8b4f9b)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2020-12-16 02:12:08 -08:00
..
__init__.py bpo-42644: Validate values in logging.disable() (GH-23786) 2020-12-16 02:12:08 -08:00
config.py bpo-39142: Avoid converting namedtuple instances to ConvertingTuple. (GH-17773) 2020-01-01 19:32:11 +00:00
handlers.py [3.9] bpo-41503: Fix race between setTarget and flush in logging.handlers.MemoryHandler (GH-21765) (GH-21897) 2020-08-16 08:34:27 -07:00