Skip to content

Issue: Windows Compatibility - AF_UNIX Socket Error #69

@Wbeggin

Description

@Wbeggin

When running openziti on Windows, the Python package fails with an AttributeError: module 'socket' has no attribute 'AF_UNIX' error. This happens in the context.py file, line 50, where the code tries to use socket.AF_UNIX.

Environment

  • Operating System: Windows 11
  • Python version: 3.11.9
  • Ziti Python SDK version: 1.0.0

Current Workaround

I had to manually modify the context.py file, replacing:
return socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0, fd)
with
return socket.socket(getattr(socket, 'AF_UNIX', 1), socket.SOCK_STREAM, 0, fd)

This allows the code to work on Windows by using a fallback value when AF_UNIX is not available.

The same code works fine on Linux (Ubuntu WSL) but fails on native Windows. The socket functionality itself works after the modification.

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