[issue25291] better Exception message for certain task termination scenario

2022-03-15 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Python 3.7 forbids Task.set_exception() and Task.set_result(), the error 
message is pretty clear.

Nothing to do here

--
nosy: +asvetlov
resolution:  -> wont fix
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



[issue25291] better Exception message for certain task termination scenario

2021-09-03 Thread Irit Katriel


Irit Katriel  added the comment:

This is doing something different now (on 3.11):

iritkatriel@Irits-MBP cpython % ./python.exe ttt.py
/Users/iritkatriel/src/cpython/ttt.py:5: DeprecationWarning: There is no 
current event loop
  loop = asyncio.get_event_loop()
i am task..

[here it hangs and I kill it with ctrl-C]

^CTraceback (most recent call last):
  File "/Users/iritkatriel/src/cpython/ttt.py", line 12, in 
loop.run_forever()
^^
  File "/Users/iritkatriel/src/cpython/Lib/asyncio/base_events.py", line 595, 
in run_forever
self._run_once()

  File "/Users/iritkatriel/src/cpython/Lib/asyncio/base_events.py", line 1841, 
in _run_once
event_list = self._selector.select(timeout)
 ^^
  File "/Users/iritkatriel/src/cpython/Lib/selectors.py", line 562, in select
kev_list = self._selector.control(None, max_ev, timeout)
   ^
KeyboardInterrupt
Task exception was never retrieved
future:  exception=RuntimeError('Task does not 
support set_exception operation')>
Traceback (most recent call last):
  File "/Users/iritkatriel/src/cpython/ttt.py", line 8, in task
myself.set_exception(RuntimeError('something bad'))
^^^
RuntimeError: Task does not support set_exception operation

--
nosy: +iritkatriel

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Guido van Rossum

Guido van Rossum added the comment:

(OK, issue should be all cleaned up. :-)

--

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Guido van Rossum

Changes by Guido van Rossum :


--
Removed message: http://bugs.python.org/msg252053

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Guido van Rossum

Changes by Guido van Rossum :


--
Removed message: http://bugs.python.org/msg252051

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Guido van Rossum

Changes by Guido van Rossum :


Removed file: http://bugs.python.org/file40651/example_files.tar.gz

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Guido van Rossum

Changes by Guido van Rossum :


--
Removed message: http://bugs.python.org/msg252050

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Guido van Rossum

Guido van Rossum added the comment:

Can you fix the issue title or do you want me to fix it? And did you also add a 
file you meant to go to a different issue? (Maybe link to the new issue and I 
can figure it out.)

--

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Oleg

Changes by Oleg :


--
title: ssl socket gets into broken state when client exits during handshake -> 
better Exception message for certain task termination scenario

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2015-10-01 Thread Oleg

New submission from Oleg:

the weird condition in the code 
causes the task to end with double exception, hard
to understand what really had happened. 

 
producing output like that:


|i am task..
|i keep working
|Exception in callback Task._step()
|handle: 
|Traceback (most recent call last):
|  File "/home/http/Python-3.5.0/lib/python3.5/asyncio/tasks.py", line 239, 
in _step
|result = coro.send(value)
|StopIteration
|
|During handling of the above exception, another exception occurred:
|
|Traceback (most recent call last):
|  File "/home/http/Python-3.5.0/lib/python3.5/asyncio/events.py", line 
125, in _run
|self._callback(*self._args)
|  File "/home/http/Python-3.5.0/lib/python3.5/asyncio/tasks.py", line 241, 
in _step
|self.set_result(exc.value)
|  File "/home/http/Python-3.5.0/lib/python3.5/asyncio/futures.py", line 
335, in set_result
|raise InvalidStateError('{}: {!r}'.format(self._state, self))
|asyncio.futures.InvalidStateError: FINISHED:  exception=RuntimeError('something 
bad',)>


it would be good to improve that shutdown procedure 
to pinpoint real reason why and when it got into broken state.

additional info can be found here:
https://groups.google.com/forum/#!topic/python-tulip/-EcYtJXDvSo

--
components: asyncio
files: test_aio_exception.py
messages: 252049
nosy: gvanrossum, haypo, ovex, yselivanov
priority: normal
severity: normal
status: open
title: better Exception message for certain task termination scenario
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file40650/test_aio_exception.py

___
Python tracker 

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