Skip to content

Create socket file in /tmp #5003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 4, 2018
Merged

Create socket file in /tmp #5003

merged 3 commits into from
May 4, 2018

Conversation

myjian
Copy link
Contributor

@myjian myjian commented May 4, 2018

When the mypy daemon runs in Windows Subsystem for Linux (WSL) under a DriveFs directory, it would fail to bind to the socket file.

From mypy/dmypy_server.py:

sock = socket.socket(socket.AF_UNIX)
sock.bind(self.sockname)  # <-- stuck here
sock.listen(1)

This pull request changes the path to /tmp, so on Windows it will be always created under the VolFs, which provides full support for Linux file system features.

Copy link
Collaborator

@msullivan msullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just moving the socket to /tmp/dmypy.sock means that mypy-daemon can only be run on one codebase at a time per system. We need to generate a temporary directory using tempfile and put it there.

@msullivan msullivan merged commit 211a654 into python:master May 4, 2018
@msullivan
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants