Skip to content

asyncio: six factory signatures show a limit=None default that is not accepted #156246

Description

@deadlovelll

Documentation

Six signatures document limit=None, but the real default is 2 ** 16 and
None is not a valid option:

asyncio-stream.rst 52, 92, 140, 172 - open_connection, start_server, open_unix_connection, start_unix_server
asyncio-subprocess.rst 65, 87 - create_subprocess_exec, create_subprocess_shell

For example with open_connection:

import asyncio
asyncio.run(asyncio.open_connection("127.0.0.1", 9, limit=None))

Will raise TypeError: '<=' not supported between instances of 'NoneType' and 'int'

Proposed fix is to replace limit=None with limit=65536

Have a fix ready for that

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status
    Done
    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions