Skip to content

socket.AF_VSOCK is not defined #1050

@bluecmd

Description

@bluecmd

Hi,

Problem

bluecmd@fedora:~/Downloads$ tar -xf cpython-3.14.3+20260320-x86_64_v3-unknown-linux-gnu-install_only.tar.gz
bluecmd@fedora:~/Downloads$ ./python/bin/python
Python 3.14.3 (main, Mar 20 2026, 00:35:02) [Clang 22.1.1 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.AF_VSOCK
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    socket.AF_VSOCK
AttributeError: module 'socket' has no attribute 'AF_VSOCK'
>>> exit

Expected output

bluecmd@fedora:~/Downloads$ python
Python 3.14.3 (main, Feb  4 2026, 00:00:00) [GCC 15.2.1 20260123 (Red Hat 15.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.AF_VSOCK
<AddressFamily.AF_VSOCK: 40>

Investigation

Probably caused by the build environment not having AF_VSOCK available in header files. In my system it is defined in /usr/include/bits/socket.h

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