On 2/7/2014, 3:52 PM, Guido van Rossum wrote:
Can't you add a reference to the loop to the tb logger object? The loop
should outlive any futures anyway (since the future has a reference to the
loop) and it shouldn't be a ref cycle.
Sure.
Another question: "logger.exception" is also used in:
- selector_events.py: in _accept_connection, in case of errors in
pause_writing/resume_writing and _fatal_error
- proactor_events.py: in case of failed accept, _fatal_error and errors
in pause/resume writing
- unix_events.py: In pipe transport's _fatal_error, in case of
exception in SIGCHLD handler
- windows_events.py: pipe accept failed
All of the above sites are logging exceptions (typically OSErrors).
Should we use the loop exception API there, or you want to keep using
loggers directly?
And one more, aesthetic question: the currently agreed on signature of
exception handlers is '(loop, context)'. I have a method
"BaseEventLoop.default_exception_handler(self, context)", but when the
method is bound, its signature is just '(context)', hence, this bound
method cannot be passed to 'set_exception_handler'. Should the signature
be "BaseEventLoop.default_exception_handler(self, loop, context)", or
can I just make it a staticmethod with '(loop, context)'?
Yury