diff --git a/pyftpdlib/servers.py b/pyftpdlib/servers.py index 32c0db02..3dfc39c6 100644 --- a/pyftpdlib/servers.py +++ b/pyftpdlib/servers.py @@ -579,6 +579,13 @@ class MultiprocessFTPServer(_SpawnerBase): _lock = multiprocessing.Lock() _exit = multiprocessing.Event() + # Python 3.14 changed the non-macOS POSIX default to forkserver + # but the code in this module does not work with it + # See https://github.com/python/cpython/issues/125714 + if multiprocessing.get_start_method() == 'forkserver': + _mp_context = multiprocessing.get_context(method='fork') + else: + _mp_context = multiprocessing.get_context() def _start_task(self, *args, **kwargs): - return multiprocessing.Process(*args, **kwargs) + return self._mp_context.Process(*args, **kwargs)