summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Lib/logging
diff options
context:
space:
mode:
authorshadchin <[email protected]>2023-12-13 02:43:57 +0300
committershadchin <[email protected]>2023-12-13 03:08:48 +0300
commit5b48aabc614c6d407f885f3b228dc484ad4c5ba9 (patch)
tree602eb5cc5d85bf730c1de1fa50a13c2ee552830d /contrib/tools/python3/src/Lib/logging
parent35d7049b38602e8cbfcd3f96257329a1abce947e (diff)
Update Python 3 to 3.11.7
Diffstat (limited to 'contrib/tools/python3/src/Lib/logging')
-rw-r--r--contrib/tools/python3/src/Lib/logging/config.py12
-rw-r--r--contrib/tools/python3/src/Lib/logging/handlers.py6
2 files changed, 8 insertions, 10 deletions
diff --git a/contrib/tools/python3/src/Lib/logging/config.py b/contrib/tools/python3/src/Lib/logging/config.py
index 7e78a64a2f0..735ffbe1946 100644
--- a/contrib/tools/python3/src/Lib/logging/config.py
+++ b/contrib/tools/python3/src/Lib/logging/config.py
@@ -1,4 +1,4 @@
-# Copyright 2001-2019 by Vinay Sajip. All Rights Reserved.
+# Copyright 2001-2023 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
@@ -19,7 +19,7 @@ Configuration functions for the logging package for Python. The core package
is based on PEP 282 and comments thereto in comp.lang.python, and influenced
by Apache's log4j system.
-Copyright (C) 2001-2019 Vinay Sajip. All Rights Reserved.
+Copyright (C) 2001-2023 Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
"""
@@ -477,10 +477,10 @@ class BaseConfigurator(object):
c = config.pop('()')
if not callable(c):
c = self.resolve(c)
- props = config.pop('.', None)
# Check for valid identifiers
- kwargs = {k: config[k] for k in config if valid_ident(k)}
+ kwargs = {k: config[k] for k in config if (k != '.' and valid_ident(k))}
result = c(**kwargs)
+ props = config.pop('.', None)
if props:
for name, value in props.items():
setattr(result, name, value)
@@ -752,8 +752,7 @@ class DictConfigurator(BaseConfigurator):
'address' in config:
config['address'] = self.as_tuple(config['address'])
factory = klass
- props = config.pop('.', None)
- kwargs = {k: config[k] for k in config if valid_ident(k)}
+ kwargs = {k: config[k] for k in config if (k != '.' and valid_ident(k))}
try:
result = factory(**kwargs)
except TypeError as te:
@@ -771,6 +770,7 @@ class DictConfigurator(BaseConfigurator):
result.setLevel(logging._checkLevel(level))
if filters:
self.add_filters(result, filters)
+ props = config.pop('.', None)
if props:
for name, value in props.items():
setattr(result, name, value)
diff --git a/contrib/tools/python3/src/Lib/logging/handlers.py b/contrib/tools/python3/src/Lib/logging/handlers.py
index eadd1b6340b..81041488c8b 100644
--- a/contrib/tools/python3/src/Lib/logging/handlers.py
+++ b/contrib/tools/python3/src/Lib/logging/handlers.py
@@ -833,10 +833,8 @@ class SysLogHandler(logging.Handler):
"local7": LOG_LOCAL7,
}
- #The map below appears to be trivially lowercasing the key. However,
- #there's more to it than meets the eye - in some locales, lowercasing
- #gives unexpected results. See SF #1524081: in the Turkish locale,
- #"INFO".lower() != "info"
+ # Originally added to work around GH-43683. Unnecessary since GH-50043 but kept
+ # for backwards compatibility.
priority_map = {
"DEBUG" : "debug",
"INFO" : "info",