Skip to content

fix: make mirror_sync parallel downloads work on Python 3.14 - #386

Open
ahresse wants to merge 1 commit into
fluendo:masterfrom
ahresse:mirror-sync-python314
Open

fix: make mirror_sync parallel downloads work on Python 3.14#386
ahresse wants to merge 1 commit into
fluendo:masterfrom
ahresse:mirror-sync-python314

Conversation

@ahresse

@ahresse ahresse commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

The parallel sync path passed a function defined inside sync_urls to multiprocessing.Pool.map. Local functions cannot be pickled, which broke under Python 3.14 where the default start method on Linux changed from fork to forkserver (tasks are pickled to workers).

Hoist _sync_one to module level and pass the closure values through a functools.partial, which is picklable.

Previously undetected because tested on Ubuntu 24.04 (python 3.12).

sources:

The parallel sync path passed a function defined inside sync_urls to
multiprocessing.Pool.map. Local functions cannot be pickled, which broke
under Python 3.14 where the default start method on Linux changed from
fork to forkserver (tasks are pickled to workers).

Hoist _sync_one to module level and pass the closure values through a
functools.partial, which is picklable.

Signed-off-by: Alexandre Esse <alexandre.esse@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant