[issue20652] Example in asyncio task gives resource warning

2014-03-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 36005fe2ab9b by Victor Stinner in branch '3.4':
Close #20652: asyncio doc: close the event loop in run_forever() example. Fix
http://hg.python.org/cpython/rev/36005fe2ab9b

--

___
Python tracker 

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



[issue20652] Example in asyncio task gives resource warning

2014-02-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ea4c74cc4da5 by Victor Stinner in branch 'default':
Close #20652: asyncio doc: close the event loop in run_forever() example. Fix
http://hg.python.org/cpython/rev/ea4c74cc4da5

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue20652] Example in asyncio task gives resource warning

2014-02-16 Thread Vajrasky Kok

Vajrasky Kok added the comment:

The patch also fixed some typos.

s/Future in done/Future is done/

--
Added file: 
http://bugs.python.org/file34112/shut_off_resource_warning_run_forever_asyncio_example.patch

___
Python tracker 

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



[issue20652] Example in asyncio task gives resource warning

2014-02-16 Thread Vajrasky Kok

Changes by Vajrasky Kok :


Removed file: 
http://bugs.python.org/file34111/shut_off_resource_warning_run_forever_asyncio_example.patch

___
Python tracker 

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



[issue20652] Example in asyncio task gives resource warning

2014-02-16 Thread Vajrasky Kok

New submission from Vajrasky Kok:

>From 
>http://docs.python.org/3.4/library/asyncio-task.html#example-future-with-run-until-complete

there is an example code:
import asyncio

@asyncio.coroutine
def slow_operation(future):
yield from asyncio.sleep(1)
future.set_result('Future in done!')

def got_result(future):
print(future.result())
loop.stop()

loop = asyncio.get_event_loop()
future = asyncio.Future()
asyncio.Task(slow_operation(future))
future.add_done_callback(got_result)
loop.run_forever()


I got this:
ethan@amiau:~/Documents/code/python/cpython3.4$ ./python /tmp/demo.py
Future in done!
sys:1: ResourceWarning: unclosed 
sys:1: ResourceWarning: unclosed 

Here is the patch to shut off the resource warning.

--
assignee: docs@python
components: Documentation
files: shut_off_resource_warning_run_forever_asyncio_example.patch
keywords: patch
messages: 211392
nosy: docs@python, haypo, vajrasky
priority: normal
severity: normal
status: open
title: Example in asyncio task gives resource warning
type: resource usage
versions: Python 3.4
Added file: 
http://bugs.python.org/file34111/shut_off_resource_warning_run_forever_asyncio_example.patch

___
Python tracker 

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