Bug 2328701

Summary: python-pytest-localftpserver fails to build with Python 3.14: multiprocessing has changed the start method to 'forkserver'
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-pytest-localftpserverAssignee: Ben Beasley <code>
Status: CLOSED ERRATA QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: code, gui1ty, ksurma, mhroncok, neuro-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-pytest-localftpserver-1.3.2-2.fc42 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-11-26 15:59:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2322407    

Description Karolina Surma 2024-11-25 16:27:18 UTC
python-pytest-localftpserver fails to build with Python 3.14.0a2.

____________ ERROR at setup of test_fail_due_to_closed_module_scope ____________

request = <SubRequest 'ftpserver' for <Function test_ftpserver_class>>

    @pytest.fixture(scope=FIXTURE_SCOPE)
    def ftpserver(request):
        """The returned ``ftpsever`` provides a threaded instance of
        ``pyftpdlib.servers.FTPServer`` running on localhost.
    
        For details on the usage and configuration  check out the docs at:
        https://pytest-localftpserver.readthedocs.io/en/latest/usage.html
    
        Yields
        ------
        ftpserver: FunctionalityWrapper
            The type of `ftpserver` isn't actually `FunctionalityWrapper`,
            but a subclass with `threading.Thread` or `multiprocessing.Process`
            depending on the OS. But for autocomplete sake and since
            `FunctionalityWrapper` holds all functionality, let's pretend that it is
            `FunctionalityWrapper`.
        """
>       server = PytestLocalFTPServer()

../BUILDROOT/usr/lib/python3.14/site-packages/pytest_localftpserver/plugin.py:31: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../BUILDROOT/usr/lib/python3.14/site-packages/pytest_localftpserver/servers.py:1170: in __init__
    self.process.start()
/usr/lib64/python3.14/multiprocessing/process.py:121: in start
    self._popen = self._Popen(self)
/usr/lib64/python3.14/multiprocessing/context.py:224: in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
/usr/lib64/python3.14/multiprocessing/context.py:300: in _Popen
    return Popen(process_obj)
/usr/lib64/python3.14/multiprocessing/popen_forkserver.py:35: in __init__
    super().__init__(process_obj)
/usr/lib64/python3.14/multiprocessing/popen_fork.py:20: in __init__
    self._launch(process_obj)
/usr/lib64/python3.14/multiprocessing/popen_forkserver.py:47: in _launch
    reduction.dump(process_obj, buf)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

obj = <Process name='Process-1' parent=252 initial daemon>
file = <_io.BytesIO object at 0x7f3104641300>, protocol = None

    def dump(obj, file, protocol=None):
        '''Replacement for pickle.dump() using ForkingPickler.'''
>       ForkingPickler(file, protocol).dump(obj)
E       TypeError: cannot pickle 'select.epoll' object
E       when serializing dict item '_poller'
E       when serializing pyftpdlib.ioloop.Epoll state
E       when serializing pyftpdlib.ioloop.Epoll object
E       when serializing dict item 'ioloop'
E       when serializing pytest_localftpserver.servers.SimpleFTPServer state
E       when serializing pytest_localftpserver.servers.SimpleFTPServer object
E       when serializing tuple item 0
E       when serializing method reconstructor arguments
E       when serializing method object
E       when serializing dict item '_target'
E       when serializing multiprocessing.context.Process state
E       when serializing multiprocessing.context.Process object

Upstream PR: https://github.com/oz123/pytest-localftpserver/pull/351

https://docs.python.org/3.14/whatsnew/3.14.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08309950-python-pytest-localftpserver/

For all our attempts to build python-pytest-localftpserver with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-pytest-localftpserver/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro HronĨok 2024-11-25 17:25:34 UTC
Upstream fix: https://github.com/oz123/pytest-localftpserver/pull/351

Comment 3 Fedora Update System 2024-11-26 15:56:37 UTC
FEDORA-2024-944c9b478b (python-pytest-localftpserver-1.3.2-2.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-944c9b478b

Comment 4 Fedora Update System 2024-11-26 15:59:35 UTC
FEDORA-2024-944c9b478b (python-pytest-localftpserver-1.3.2-2.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.