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

Guido van Rossum guido at python.org
Thu Feb 7 01:11:37 CET 2013


On Wed, Feb 6, 2013 at 3:58 PM, Richard Oudkerk <shibturn at gmail.com> wrote:
> 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

Good catch! What's going on is that the super().tearDown() call was
missing from EventLoopTestsMixin. I'll fix that -- then we'll have to
separately add suppress_log_errors() calls to various tests (I'll do
that at a slower pace).

-- 
--Guido van Rossum (python.org/~guido)



More information about the Python-ideas mailing list