diff --git a/sanic/server.py b/sanic/server.py index d83042eb..8d4b5db2 100644 --- a/sanic/server.py +++ b/sanic/server.py @@ -567,7 +567,7 @@ def serve(host, port, request_handler, error_handler, before_start=None, debug=debug, ) - if isinstance(sock, str): + if hasattr(sock, '__fspath__'): server_coroutine = loop.create_unix_server( server, path=sock,