Skip to content

Commit c9827da

Browse files
Fix iOS socket path
1 parent 6c20f23 commit c9827da

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/test/test_shutil.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1563,7 +1563,11 @@ def test_copyfile_socket(self):
15631563
sock_path = os.path.join(self.mkdtemp(), 'sock')
15641564
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
15651565
self.addCleanup(sock.close)
1566-
socket_helper.bind_unix_socket(sock, sock_path)
1566+
try:
1567+
socket_helper.bind_unix_socket(sock, sock_path)
1568+
except OSError as e:
1569+
# AF_UNIX path too long (e.g. on iOS)
1570+
self.skipTest(f'cannot bind AF_UNIX socket: {e}')
15671571
self.addCleanup(os_helper.unlink, sock_path)
15681572
self.assertRaisesRegex(shutil.SpecialFileError, 'is a socket',
15691573
shutil.copyfile, sock_path, sock_path + '.copy')

0 commit comments

Comments
 (0)