Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8a435c47
Commit
8a435c47
authored
Jul 20, 2010
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #9310: backported logging fix from 2.7.
parent
ae7dd8fa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
Lib/logging/config.py
Lib/logging/config.py
+4
-1
Lib/test/test_logging.py
Lib/test/test_logging.py
+6
-0
No files found.
Lib/logging/config.py
View file @
8a435c47
...
...
@@ -104,6 +104,9 @@ def _resolve(name):
def
_strip_spaces
(
alist
):
return
map
(
lambda
x
:
string
.
strip
(
x
),
alist
)
def
_encoded
(
s
):
return
s
if
isinstance
(
s
,
str
)
else
s
.
encode
(
'utf-8'
)
def
_create_formatters
(
cp
):
"""Create and return formatters"""
flist
=
cp
.
get
(
"formatters"
,
"keys"
)
...
...
@@ -214,7 +217,7 @@ def _install_loggers(cp, handlers, disable_existing_loggers):
#avoid disabling child loggers of explicitly
#named loggers. With a sorted list it is easier
#to find the child loggers.
existing
.
sort
()
existing
.
sort
(
key
=
_encoded
)
#We'll keep the list of existing loggers
#which are children of named loggers here...
child_loggers
=
[]
...
...
Lib/test/test_logging.py
View file @
8a435c47
...
...
@@ -69,6 +69,12 @@ class BaseTest(unittest.TestCase):
finally:
logging._releaseLock()
# Set two unused loggers: one non-ASCII and one Unicode.
# This is to test correct operation when sorting existing
# loggers in the configuration code. See issues 8201, 9310.
logging.getLogger("
\
xab
\
xd7
\
xbb
")
logging.getLogger(u"
\
u013f
\
u00d6
\
u0047
")
self.root_logger = logging.getLogger("")
self.original_logging_level = self.root_logger.getEffectiveLevel()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment