[issue21921] Example in asyncio event throws resource usage warning

2014-07-05 Thread Vajrasky Kok

New submission from Vajrasky Kok:

These examples coming from:
https://docs.python.org/3/library/asyncio-eventloop.html#example-hello-world-callback

and

https://docs.python.org/3/library/asyncio-eventloop.html#example-set-signal-handlers-for-sigint-and-sigterm

throw resource usage warning.

One of them gives this output:
Event loop running forever, press CTRL+c to interrupt.
pid 3075: send SIGINT or SIGTERM to exit.
^Cgot signal SIGINT: exit
sys:1: ResourceWarning: unclosed 
sys:1: ResourceWarning: unclosed 

The patch adds closing the loop code in the examples.

--
assignee: docs@python
components: Documentation, asyncio
files: close_loop_on_example.patch
keywords: patch
messages: 222344
nosy: docs@python, gvanrossum, haypo, vajrasky, yselivanov
priority: normal
severity: normal
status: open
title: Example in asyncio event throws resource usage warning
type: resource usage
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file35866/close_loop_on_example.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21921] Example in asyncio event throws resource usage warning

2014-07-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f6827c6b1164 by Victor Stinner in branch '3.4':
Closes #21921: Fix ResourceWarning in the asyncio examples: close the event
http://hg.python.org/cpython/rev/f6827c6b1164

New changeset 0533f148fb49 by Victor Stinner in branch 'default':
(Merge 3.4) Closes #21921: Fix ResourceWarning in the asyncio examples: close
http://hg.python.org/cpython/rev/0533f148fb49

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21921] Example in asyncio event throws resource usage warning

2014-07-05 Thread STINNER Victor

STINNER Victor added the comment:

Thanks for the fix. I already suggested it to Guido van Rossum a few months 
ago, but he preferred the keep the example simple. I made the same fix in the 2 
hello world examples of the Tulip project last Tuesday, so it's fair to apply 
the same fix to asyncio examples.

Thanks for the fix Vajrasky.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com