You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug A clear and concise description of what the bug is.
When black --diff is run with a long temporary directory, a confusing OSError is raised.
To Reproduce Steps to reproduce the behavior:
Create a directory with >= 2 Python files
Set the default temporary directory for tempfile.mkstemp() to something long (e.g. by using export TMPDIR=$TMPDIR$TMPDIR$TMPDIR; mkdir -p $TMPDIR).
Run Black on it with the --diff option
See error
Process SyncManager-1:
Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/opt/homebrew/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/opt/homebrew/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/managers.py", line 582, in _run_server
server = cls._Server(registry, address, authkey, serializer)
File "/opt/homebrew/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/managers.py", line 155, in __init__
self.listener = Listener(address=address, backlog=16)
File "/opt/homebrew/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/connection.py", line 453, in __init__
self._listener = SocketListener(address, family, backlog)
File "/opt/homebrew/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/connection.py", line 596, in __init__
self._socket.bind(address)
OSError: AF_UNIX path too long
Aborted!
Expected behavior A clear and concise description of what you expected to happen.
I expected to see the diff suggested by Black.
Else, I would prefer to see a clear error.
Environment (please complete the following information):
Version: 20.8b1
OS and Python version: macOS and Linux. Python 3.9.4
Does this bug also happen on master? To answer this, you have two options:
Yes.
Additional context Add any other context about the problem here.
The reason for this bug is that multiprocessing.Manager() creates a socket.
The socket default address depends on the default temporary directory.
Sockets have a maximum address length.
In my use case I am running on CI where I do not control the temporary directory. I therefore have to omit --diff.
The text was updated successfully, but these errors were encountered:
Describe the bug A clear and concise description of what the bug is.
When
black --diff
is run with a long temporary directory, a confusingOSError
is raised.To Reproduce Steps to reproduce the behavior:
tempfile.mkstemp()
to something long (e.g. by usingexport TMPDIR=$TMPDIR$TMPDIR$TMPDIR; mkdir -p $TMPDIR
).--diff
optionExpected behavior A clear and concise description of what you expected to happen.
I expected to see the diff suggested by Black.
Else, I would prefer to see a clear error.
Environment (please complete the following information):
Does this bug also happen on master? To answer this, you have two options:
Yes.
Additional context Add any other context about the problem here.
The reason for this bug is that
multiprocessing.Manager()
creates a socket.The socket default address depends on the default temporary directory.
Sockets have a maximum address length.
In my use case I am running on CI where I do not control the temporary directory. I therefore have to omit
--diff
.The text was updated successfully, but these errors were encountered: