[issue42392] remove the deprecated 'loop' parameter asyncio API

Gregory P. Smith report at bugs.python.org
Mon May 24 18:20:32 EDT 2021


Gregory P. Smith <greg at krypto.org> added the comment:

There appear to be no versionchanged:: 3.10 in the asyncio docs on the APIs that formerly accepted a loop= parameter linking people to information on when that went away (3.10) and why.  Specifically I'm talking about https://docs.python.org/3.10/library/asyncio-stream.html.

The asyncio stack traces people will face when porting code to 3.10 are mystifying (they may not even show use of a loop parameter) when this comes up, so we should really leave more bread crumbs than expecting people to find the What's New doc.

```
...
E    server = event_loop.run_until_complete(coro)
E  File "/opt/hostedtoolcache/Python/3.10.0-beta.1/x64/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
E    return future.result()
E  File "/opt/hostedtoolcache/Python/3.10.0-beta.1/x64/lib/python3.10/asyncio/streams.py", line 113, in start_unix_server
E    return await loop.create_unix_server(factory, path, **kwds)
E  TypeError: _UnixSelectorEventLoop.create_unix_server() got an unexpected keyword argument 'loop'
```

Arguably something similar to that whatsnew text should've been added to the docs in 3.8 with the loop deprecation.  Something like this?

```
.. versionchanged:: 3.7

   This function now implicitly gets the
   current thread's running event loop.

.. versionchanged:: 3.10
   That `loop` parameter has been removed.
```

including a ReST link to more info in the whats new doc on the last entry would be useful.

----------
nosy: +gregory.p.smith
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42392>
_______________________________________


More information about the Python-bugs-list mailing list