Skip to content

getaddrinfo emulation does not support AI_NUMERICSERV #74969

Closed

Description

@smejkar
mannequin
BPO 30786
Nosy @benjaminp, @csabella, @smejkar
PRs
  • bpo-30786: getaddrinfo emulation does not support AI_NUMERICSERV #2437
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-06-02.16:04:29.076>
    created_at = <Date 2017-06-27.10:40:08.523>
    labels = ['extension-modules', 'type-bug', '3.7']
    title = 'getaddrinfo emulation does not support AI_NUMERICSERV'
    updated_at = <Date 2019-06-02.16:04:29.074>
    user = 'https://github.com/smejkar'

    bugs.python.org fields:

    activity = <Date 2019-06-02.16:04:29.074>
    actor = 'cheryl.sabella'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-06-02.16:04:29.076>
    closer = 'cheryl.sabella'
    components = ['Extension Modules']
    creation = <Date 2017-06-27.10:40:08.523>
    creator = 'smejkar'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30786
    keywords = []
    message_count = 3.0
    messages = ['297020', '325323', '344294']
    nosy_count = 3.0
    nosy_names = ['benjamin.peterson', 'cheryl.sabella', 'smejkar']
    pr_nums = ['2437']
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue30786'
    versions = ['Python 3.7']

    Activity

    1. smejkar commented on Jun 27, 2017

      smejkarmannequin
      MannequinAuthor

      Modules/getaddrinfo.c should support AI_NUMERICSERV.

      Moreover, not supporting AI_NUMERICSERV may cause troubles on platforms where the getaddrinfo function is available but it's buggy (see configure.ac and Modules/socketmodule.c), because Modules/addrinfo.h does not #undef AI_NUMERICSERV and Modules/socketmodule.c exports AI_NUMERICSERV defined in a system header that may collide with another flag defined in Modules/addrinfo.h and confuse the user.

      ./configure --with-pydebug
      Comment out HAVE_GETADDRINFO in pyconfig.h
      Comment out ENABLE_IPV6 in pyconfig.h on platforms where getipnodebyname and friends are not available
      make -j
      ./python
      Python 3.7.0a0 (default, Jun 27 2017, 11:59:50) 
      [GCC 4.7.2] on linux
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import socket
      >>> socket.AI_NUMERICSERV
      <AddressInfo.AI_ADDRCONFIG: 1024>
      >>> socket.getaddrinfo(None, "http", flags=socket.AI_NUMERICSERV)
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "/home/radek/src/github/cpython/Lib/socket.py", line 743, in getaddrinfo
          for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
      socket.gaierror: [Errno 3] invalid value for ai_flags.
      >>>
    2. benjaminp commented on Sep 14, 2018

      @benjaminp
      Contributor

      What platform needs Modules/getaddrinfo.c these days?

    3. csabella commented on Jun 2, 2019

      @csabella
      Contributor

      I'm going to close this as the OP hasn't provided a response to Benjamin's question. It can be re-opened if additional information is provided. Thanks!

    4. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)end of lifeextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions