[Python-ideas] PEP 3156/Tulip: Extensible EventLoop interface

Richard Oudkerk shibturn at gmail.com
Thu Feb 7 00:58:03 CET 2013


On 06/02/2013 10:43pm, Guido van Rossum wrote:
> Me neither.:-(
>
> The message "Exception in task" means that it is a task that raises an
> exception. I used to ignore these; now I log them always, but ideally
> they should only be logged when whoever waits for the Task doesn't
> catch them (or, better, when nobody waits for the task). I tried to
> implement that part but I couldn't get it to work (yet) -- I will have
> to get back to this at some point, because accurate exception logging
> (never silent, but not too spammy either) is very important for a good
> user experience.
>
> But it remains a mystery why they sometimes show and not other times.
> It suggests there's some indeterminate timing in some tests. If it
> happens only the first time when the tests are run this usually points
> to a timing behavior that's different when the source code is parsed
> as opposed to read from a .pyc file.

Commenting out the one use of suppress_log_errors() makes the "expected 
errors" appear on Linux too.  But I would have thought that that would 
only effect the test which uses suppress_log_errors().

diff -r 65c456e2c20e tulip/events_test.py
--- a/tulip/events_test.py      Wed Feb 06 19:08:14 2013 +0000
+++ b/tulip/events_test.py      Wed Feb 06 23:51:32 2013 +0000
@@ -508,7 +508,7 @@
          self.assertFalse(sock.close.called)

      def test_accept_connection_exception(self):
-        self.suppress_log_errors()
+        #self.suppress_log_errors()

          sock = unittest.mock.Mock()
          sock.accept.side_effect = socket.error

-- 
Richard




More information about the Python-ideas mailing list