Fwd: improve TypeError for AsyncIterables when attempting to sync iterate

2019-02-10 Thread Thomas Grainger
Currently when attempting to sync iterate an async iterable you get a
TypeError:

TypeError: 'SomeType' object is not iterable

When attempting to iterate an async iterable (eg an object with a __aiter__
method the error could be something like:

TypeError: 'SomeType' object is not iterable, it is however an
AsyncIterable. Use `async for` instead.
-- 
https://mail.python.org/mailman/listinfo/python-list


asyncio KeyboardInterrupt in select

2019-03-27 Thread Thomas Grainger
It seems quite easy to cause asyncio to deadlock:

  File "/usr/lib/python3.6/asyncio/base_events.py", line 1404, in _run_once
event_list = self._selector.select(timeout)
  File "/usr/lib/python3.6/selectors.py", line 445, in select
fd_event_list = self._epoll.poll(timeout, max_ev)
KeyboardInterrupt
^CError in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 40, in
_python_exit
t.join()
  File "/usr/lib/python3.6/threading.py", line 1056, in join
self._wait_for_tstate_lock()
  File "/usr/lib/python3.6/threading.py", line 1072, in
_wait_for_tstate_lock
elif lock.acquire(block, timeout):

and you get a lot of hits for this exception on google:
https://www.google.com/search?q=File+
"/usr/lib/python3.6/selectors.py",+line+445,+in+select+fd_event_list+%3D+self._epoll.poll(timeout,+max_ev)+KeyboardInterrupt&filter=0

Thomas Grainger
-- 
https://mail.python.org/mailman/listinfo/python-list