[issue46309] Task created by StreamReaderProtocol gets garbage collected.

2022-01-11 Thread Alex Waygood


Change by Alex Waygood :


--
nosy:  -AlexWaygood

___
Python tracker 

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



[issue46309] Task created by StreamReaderProtocol gets garbage collected.

2022-01-11 Thread Alex Waygood


Alex Waygood  added the comment:

I'm removing 3.7 and 3.8 from the "versions" field, since those branches are 
old enough that they're now only accepting security-related patches.

--
nosy: +AlexWaygood
versions:  -Python 3.7, Python 3.8

___
Python tracker 

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



[issue46309] Task created by StreamReaderProtocol gets garbage collected.

2022-01-11 Thread Simon Wrede


Change by Simon Wrede :


--
versions: +Python 3.11, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue46309] Task created by StreamReaderProtocol gets garbage collected.

2022-01-09 Thread Simon Wrede


Change by Simon Wrede :


--
keywords: +patch
pull_requests: +28710
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30505

___
Python tracker 

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



[issue46309] Task created by StreamReaderProtocol gets garbage collected.

2022-01-08 Thread Kumar Aditya


Change by Kumar Aditya :


--
nosy: +kumaraditya303

___
Python tracker 

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



[issue46309] Task created by StreamReaderProtocol gets garbage collected.

2022-01-08 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thanks for the bug report.

Seems like your analysis is correct.

Could you make a pull request which adds a task reference?

--

___
Python tracker 

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



[issue46309] Task created by StreamReaderProtocol gets garbage collected.

2022-01-08 Thread Simon Wrede


Change by Simon Wrede :


--
type:  -> behavior

___
Python tracker 

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



[issue46309] Task created by StreamReaderProtocol gets garbage collected.

2022-01-08 Thread Simon Wrede


New submission from Simon Wrede :

Documentation states that a reference must be kept when creating a task, 
https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task.

This is not done in StreamReaderProtocol, 
https://github.com/python/cpython/blob/main/Lib/asyncio/streams.py#L244.

I've provided a simple example to force garbage collection of this task which 
results in `Task was destroyed but it is pending!`. Uncommenting the commented 
code of the example shows that the task is not destroyed when a reference is 
kept.

Am I missing something or using the library incorrectly? I've followed the 
examples at 
https://docs.python.org/3/library/asyncio-stream.html#tcp-echo-server-using-streams.

--
components: asyncio
files: example.py
messages: 410124
nosy: asvetlov, simwr872, yselivanov
priority: normal
severity: normal
status: open
title: Task created by StreamReaderProtocol gets garbage collected.
versions: Python 3.10
Added file: https://bugs.python.org/file50552/example.py

___
Python tracker 

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