progval / Limnoria

A robust, full-featured, and user/programmer-friendly Python IRC bot, with many existing plugins.
https://docs.limnoria.net/
Other
621 stars 174 forks source link

Add support for Python 3.14.0-alpha1 #1599

Open progval opened 1 month ago

progval commented 1 month ago

This is tough: Python 3.14 switches multiprocessing's default start method from fork to forkserver, which requires target functions to be picklable.

The above commits fix the low-hanging fruits, but there is still the issue of plugins using target=self._some_method, because methods reference their plugin class, which can only be unpickled if the module containing the plugin class can be imported. And generally it can't, because plugin modules are not on Python's import path, as they are imported with this:

https://github.com/progval/Limnoria/blob/54c09809786db7a6468c48dedc788287fbcded72/src/plugin.py

after the forkserver is started

Of course we can change the start method back to fork when Limnoria starts, but it doesn't solve the issue that it is unsafe in threaded programs (which Limnoria is)

progval commented 1 month ago

Of course we can change the start method back to fork when Limnoria starts, but it doesn't solve the issue that it is unsafe in threaded programs (which Limnoria is)

Let's do that. I opened https://github.com/progval/Limnoria/issues/1600 about this