[issue37742] logging.getLogger accepts name='root' leading to confusion

2019-08-02 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37742] logging.getLogger accepts name='root' leading to confusion

2019-08-02 Thread Vinay Sajip

Vinay Sajip  added the comment:


New changeset cb65b3a4f484ce71dcb76a918af98c7015513025 by Vinay Sajip in branch 
'master':
bpo-37742: Return the root logger when logging.getLogger('root') is c… (#15077)
https://github.com/python/cpython/commit/cb65b3a4f484ce71dcb76a918af98c7015513025


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37742] logging.getLogger accepts name='root' leading to confusion

2019-08-02 Thread Vinay Sajip


Change by Vinay Sajip :


--
keywords: +patch
pull_requests: +14824
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15077

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37742] logging.getLogger accepts name='root' leading to confusion

2019-08-02 Thread Vinay Sajip


Change by Vinay Sajip :


--
assignee:  -> vinay.sajip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37742] logging.getLogger accepts name='root' leading to confusion

2019-08-02 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

It looks like the issue is that the root logger is missing from the manager's 
loggerDict.

A suggested fix is to change the creation of the loggerDict in the Manager 
class:

-   self.loggerDict = {}
+   self.loggerDict = {rootnode.name: rootnode}

This may have been omitted from the initial design to avoid reference cycles; 
however, with the advent of garbage collection this should no longer be an 
issue.  Alternatively, a weak reference could be used.

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37742] logging.getLogger accepts name='root' leading to confusion

2019-08-01 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vinay.sajip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37742] logging.getLogger accepts name='root' leading to confusion

2019-08-01 Thread Damian Yurzola


New submission from Damian Yurzola :

'root' should be a reserved name to avoid this:

>>> import logging
>>> a = logging.getLogger()
>>> b = logging.getLogger('root')
>>> a.name
'root'
>>> b.name
'root'
>>> a is b
False

--
components: Library (Lib)
messages: 348877
nosy: yurzo
priority: normal
severity: normal
status: open
title: logging.getLogger accepts name='root' leading to confusion
type: enhancement
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com