jupyter / jupyter/testpath

Test failures on macOS due to OSError: AF_UNIX path too long

Open
#24 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
31
Forks
32
Avg merge
7d 10h
Merged PRs (30d)
3

Description

Similar to or same as https://github.com/psf/black/issues/2105.

```
============================= test session starts ==============================
platform darwin -- Python 3.9.6, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /private/var/folders/1s/gpt7p1x559sb7qjb_4bhq7zc75yv8y/T/nix-build-python3.9-testpath-0.5.0.drv-0/testpath-0.5.0
collected 14 items

tests/test_asserts.py FFFFFFF [ 50%]
tests/test_commands.py .... [ 78%]
tests/test_env.py ... [100%]

=================================== FAILURES ===================================
_______________________ TestAssertFunctions.test_exists ________________________

self =

def setUp(self):
self.td = TemporaryDirectory()
self.addCleanup(self.td.cleanup)

self.file_path = os.path.join(self.td.name, 'afile')
with open(self.file_path, 'w') as f:
f.write('Blah')

self.dir_path = os.path.join(self.td.name, 'adir')
os.mkdir(self.dir_path)

self.link_path = os.path.join(self.td.name, 'alink')
self.pipe_path = os.path.join(self.td.name, 'apipe')
self.socket_path = os.path.join(self.td.name, 'asocket')
if os.name == 'posix':
# Symlinks are rarely usable on Windows, because a special
# permission is needed to create them.
os.symlink(self.file_path, self.link_path)
os.mkfifo(self.pipe_path)
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
> self.sock.bind(self.socket_path)
E OSError: AF_UNIX path too long

tests/test_asserts.py:35: OSError
________________________ TestAssertFunctions.test_isdir ________________________

self =

def setUp(self):
self.td = TemporaryDirectory()
self.addCleanup(self.td.cleanup)

self.file_path = os.path.join(self.td.name, 'afile')
with open(self.file_path, 'w') as f:
f.write('Blah')

self.dir_path = os.path.join(self.td.name, 'adir')
os.mkdir(self.dir_path)

self.link_path = os.path.join(self.td.name, 'alink')
self.pipe_path = os.path.join(self.td.name, 'apipe')
self.socket_path = os.path.join(self.td.name, 'asocket')
if os.name == 'posix':
# Symlinks are rarely usable on Windows, because a special
# permission is needed to create them.
os.symlink(self.file_path, self.link_path)
os.mkfifo(self.pipe_path)
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
> self.sock.bind(self.socket_path)
E OSError: AF_UNIX path too long

tests/test_asserts.py:35: OSError
_______________________ TestAssertFunctions.test_isfile ________________________

self =

def setUp(self):
self.td = TemporaryDirectory()
self.addCleanup(self.td.cleanup)

self.file_path = os.path.join(self.td.name, 'afile')
with open(self.file_path, 'w') as f:
f.write('Blah')

self.dir_path = os.path.join(self.td.name, 'adir')
os.mkdir(self.dir_path)

self.link_path = os.path.join(self.td.name, 'alink')
self.pipe_path = os.path.join(self.td.name, 'apipe')
self.socket_path = os.path.join(self.td.name, 'asocket')
if os.name == 'posix':
# Symlinks are rarely usable on Windows, because a special
# permission is needed to create them.
os.symlink(self.file_path, self.link_path)
os.mkfifo(self.pipe_path)
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
> self.sock.bind(self.socket_path)
E OSError: AF_UNIX path too long

tests/test_asserts.py:35: OSError
___________________ TestAssertFunctions.test_isfile_symlink ____________________

self =

def setUp(self):
self.td = TemporaryDirectory()
self.addCleanup(self.td.cleanup)

self.file_path = os.path.join(self.td.name, 'afile')
with open(self.file_path, 'w') as f:
f.write('Blah')

self.dir_path = os.path.join(self.td.name, 'adir')
os.mkdir(self.dir_path)

self.link_path = os.path.join(self.td.name, 'alink')
self.pipe_path = os.path.join(self.td.name, 'apipe')
self.socket_path = os.path.join(self.td.name, 'asocket')
if os.name == 'posix':
# Symlinks are rarely usable on Windows, because a special
# permission is needed to create them.
os.symlink(self.file_path, self.link_path)
os.mkfifo(self.pipe_path)
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
> self.sock.bind(self.socket_path)
E OSError: AF_UNIX path too long

tests/test_asserts.py:35: OSError
_______________________ TestAssertFunctions.test_islink ________________________

self =

def setUp(self):
self.td = TemporaryDirectory()
self.addCleanup(self.td.cleanup)

self.file_path = os.path.join(self.td.name, 'afile')
with open(self.file_path, 'w') as f:
f.write('Blah')

self.dir_path = os.path.join(self.td.name, 'adir')
os.mkdir(self.dir_path)

self.link_path = os.path.join(self.td.name, 'alink')
self.pipe_path = os.path.join(self.td.name, 'apipe')
self.socket_path = os.path.join(self.td.name, 'asocket')
if os.name == 'posix':
# Symlinks are rarely usable on Windows, because a special
# permission is needed to create them.
os.symlink(self.file_path, self.link_path)
os.mkfifo(self.pipe_path)
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
> self.sock.bind(self.socket_path)
E OSError: AF_UNIX path too long

tests/test_asserts.py:35: OSError
_______________________ TestAssertFunctions.test_ispipe ________________________

self =

def setUp(self):
self.td = TemporaryDirectory()
self.addCleanup(self.td.cleanup)

self.file_path = os.path.join(self.td.name, 'afile')
with open(self.file_path, 'w') as f:
f.write('Blah')

self.dir_path = os.path.join(self.td.name, 'adir')
os.mkdir(self.dir_path)

self.link_path = os.path.join(self.td.name, 'alink')
self.pipe_path = os.path.join(self.td.name, 'apipe')
self.socket_path = os.path.join(self.td.name, 'asocket')
if os.name == 'posix':
# Symlinks are rarely usable on Windows, because a special
# permission is needed to create them.
os.symlink(self.file_path, self.link_path)
os.mkfifo(self.pipe_path)
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
> self.sock.bind(self.socket_path)
E OSError: AF_UNIX path too long

tests/test_asserts.py:35: OSError
______________________ TestAssertFunctions.test_issocket _______________________

self =

def setUp(self):
self.td = TemporaryDirectory()
self.addCleanup(self.td.cleanup)

self.file_path = os.path.join(self.td.name, 'afile')
with open(self.file_path, 'w') as f:
f.write('Blah')

self.dir_path = os.path.join(self.td.name, 'adir')
os.mkdir(self.dir_path)

self.link_path = os.path.join(self.td.name, 'alink')
self.pipe_path = os.path.join(self.td.name, 'apipe')
self.socket_path = os.path.join(self.td.name, 'asocket')
if os.name == 'posix':
# Symlinks are rarely usable on Windows, because a special
# permission is needed to create them.
os.symlink(self.file_path, self.link_path)
os.mkfifo(self.pipe_path)
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
> self.sock.bind(self.socket_path)
E OSError: AF_UNIX path too long

tests/test_asserts.py:35: OSError
=========================== short test summary info ============================
FAILED tests/test_asserts.py::TestAssertFunctions::test_exists - OSError: AF_...
FAILED tests/test_asserts.py::TestAssertFunctions::test_isdir - OSError: AF_U...
FAILED tests/test_asserts.py::TestAssertFunctions::test_isfile - OSError: AF_...
FAILED tests/test_asserts.py::TestAssertFunctions::test_isfile_symlink - OSEr...
FAILED tests/test_asserts.py::TestAssertFunctions::test_islink - OSError: AF_...
FAILED tests/test_asserts.py::TestAssertFunctions::test_ispipe - OSError: AF_...
FAILED tests/test_asserts.py::TestAssertFunctions::test_issocket - OSError: A...
========================= 7 failed, 7 passed in 1.16s ==========================
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.