yang <fhsxf...@126.com> added the comment:

You assigned a handler to a variable `formatter`, and then called 
`setFormatter(formatter)`, but `formatter` is in fact a handler. The two 
classes `Formatter` and `Handler` happen to have a same name method `format` 
which is called when logging. So what happend is the logger wants to format 
your logging string, and it calls its handlers' `format` method. And in this 
handler's `format` method, the handler calls its formatter's `format` method, 
which ends to be another handler rather than a real formatter. And you repeated 
it 1000 times, which caused a 1000-level nested recursion.

----------
nosy: +fhsxfhsx

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

Reply via email to