Skip to content

lib/python: Use fork start method where possible as Python 3.14 compatibility workaround - #7940

Closed
ninsbl wants to merge 18 commits into
OSGeo:mainfrom
ninsbl:fork_workaround
Closed

ninsbl wants to merge 18 commits into
OSGeo:mainfrom
ninsbl:fork_workaround

Conversation

@ninsbl

@ninsbl ninsbl commented Sep 23, 2026

Copy link
Copy Markdown
Member

This PR is a temporary workaround for the current lack of support for spawn and forkserver startmethods in multiprocessing.
It is necessary for Python 3.14, which uses forkserver as default startmethod on Linux instead of fork and functions that use Process from multiprocessing (pygrass and temporal) now fail on modern Linux too.

The workaround should be removed as soon as proper support for the default startmethods on the different OSes is implemented (see #6104 for status).

The content of this PR should be equivalent to: #7724. However, this one is more comprehensive in that sense that tests now also are executed with Python 3.14 and here all possible occurrences of spawnserver startmethod are guarded.
I am happy to abandon this PR when #7724 covers the remaining issues...

Given that the Ubuntu 26.04 docker image for main already ships Python 3.14, we should prioritize addressing the 3.14 compatibility issue.

@ninsbl ninsbl added this to the 8.6.0 milestone Sep 23, 2026
@ninsbl
ninsbl requested review from echoix and petrasovaa September 23, 2026 12:50
@ninsbl ninsbl added bug Something isn't working blocker Blocking a release temporal Related to temporal data processing Python Related code is in Python libraries labels Sep 23, 2026
@github-actions github-actions Bot added windows Microsoft Windows specific CI Continuous integration labels Sep 23, 2026

@echoix echoix left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. Could we have a task item to remove that helper as soon as fixed (and what to fix)? Next step: CI with 26.04 (we should have package lists separated by os version I think), but there’s probably still the issue of numpy 2 and the doctests: probably we could just make them numpy2 only and exclude them from older revisions. I’m not sure the workaround to support both would be worth it.

Also one last thing: what was happening with the blas on Windows? Are we missing something if it isn’t there? (Meaning, if openblas was the alternative of something else, now we wouldn’t have any of both ways of providing a functionality)

@petrasovaa

Copy link
Copy Markdown
Contributor

I updated mine, will comment soon

@petrasovaa

petrasovaa commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

The difference of #7724 from this PR is:

  • no changes in CI (the changes here are somewhat unclear)
  • includes DataProvider (probably unused, but still part of API)
  • includes Pipe and Lock
  • private helper function to get context, here it's public
  • stale annotation

@ninsbl ninsbl closed this Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocker Blocking a release bug Something isn't working CI Continuous integration libraries Python Related code is in Python temporal Related to temporal data processing windows Microsoft Windows specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants