Vinay Sajip <vinay_sa...@yahoo.co.uk> added the comment:

@Florent: Sorry, I didn't see your patch, for some reason. But I would say:

1. I agree that where I put the check (logging.getLogger) does not catch the 
case where someone instantiates the logger directly (using 
logging.Logger(any)), but users aren't supposed to instantiate loggers directly 
anyway - this would not result in a working logger. The check is in the same 
place where (in 2.7) we check for Unicode and encode to bytes.

2. I don't want to be too liberal in accepting logger names, since they are 
intended to mean "a place in the application". So, accepting anything other 
than text does not seem right to me - so str for 3.x, str or unicode for 2.x.

3. I thought a single test (passing in a invalid type) would be sufficient for 
the logging code, ISTM adding tests with lots of types is actually testing 
isinstance ;-)

4. I didn't notice your patch, and hence goofed in raising a ValueError instead 
of (correctly as you had it) a TypeError. I will rectify this.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13361>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to