Skip to content

Eventlet monkeypatch replacement of socket.getaddrinfo has an incorrectly named parameter, leading to TypeError #775

@wb7777

Description

@wb7777
  • eventlet version: 0.33.2
  • Python version: 3.9.5
  • Operating System: macOS Monterey 12.6.1

Description

In Python 3.2, the socket.getaddrinfo parameter socktype was renamed to type.
As a result, code that calls socket.getaddrinfo, specifying the type parameter as a keyword argument, raises a TypeError, if eventlet.monkey_patch() was called previously.

How to reproduce

$ python3
Python 3.9.5 (default, Jun 29 2021, 13:12:16) 
[Clang 12.0.5 (clang-1205.0.22.11)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import eventlet; eventlet.monkey_patch()
>>> from smtpd import SMTPServer
>>> SMTPServer(("127.0.0.1", 25), None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/user/.pyenv/versions/3.9.5/lib/python3.9/smtpd.py", line 645, in __init__
    gai_results = socket.getaddrinfo(*localaddr,
TypeError: getaddrinfo() got an unexpected keyword argument 'type'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions