Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Tests fail with "OSError: AF_UNIX path too long" if TMPDIR path is longer than 107 bytes #93852

Copy link
Copy link
Closed
@vstinner

Description

@vstinner
Issue body actions

The Python test suite has multiple tests on AF_UNIX sockets. They create a temporary socket path. Example with test_socketserver:

return tempfile.mktemp(prefix='unix_socket.')

The problem is that if the temporary directory is too long, creating a socket with this path fails with "OSError: AF_UNIX path too long". On Linux, sun_path is 107 bytes.

With my PR #93817, TMPDIR becomes something like (...)/test_python_157983_æ/test_python_worker_243024_æ_tmpdir/. For example, the path /home/vstinner/python/main/build/test_python_157983_æ/test_python_worker_243024_æ_tmpdir/unix_socket.xxxxxxxx is 11 bytes long, longer than the limit of 107 bytes.

I see different options:

  • Use a relative path
  • Create a temporary socket path in the current directory rather than in TMPDIR
  • Skip tests if AF_UNIX path is too long

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.