[issue21921] Example in asyncio event throws resource usage warning

Vajrasky Kok report at bugs.python.org
Sat Jul 5 10:45:13 CEST 2014


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 <socket object at 0x7f7124783448>
sys:1: ResourceWarning: unclosed <socket object at 0x7f7124c230e8>

The patch adds closing the loop code in the examples.

----------
assignee: docs at python
components: Documentation, asyncio
files: close_loop_on_example.patch
keywords: patch
messages: 222344
nosy: docs at 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 <report at bugs.python.org>
<http://bugs.python.org/issue21921>
_______________________________________


More information about the Python-bugs-list mailing list