Repository navigation
📝 docs(testing): show directory isolation in spawned workers - #754
Merged
gaborbernat merged 2 commits intoNov 27, 2026
Merged
Conversation
Add an executable process-pool example and a spawned-process test covering independent child paths, explicit child isolation, file placement and restoration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
platformdirs.testing.isolated_dirsredirects every directory under a root by patching the class in memory. A forked child inherits that patch, but a spawned process starts with fresh module state, so wrapping only the parent leaves a spawned worker on the user's real directories. The how-to guide said spawned children start with the original paths but did not show how to isolate one. 🧪 Once this merges, the guide has a runnableProcessPoolExecutorexample: the parent passes a root as the task argument, the worker entersisolated_dirswith it, and the temporary directory holding the root outlives the pool.Library behavior stays the same. Isolation remains per process, and each worker opts in with its own root. Concurrent workers that must not share files get separate roots.
Supersedes #751 by @PriyansuMaurya, whose commit is kept unchanged. That fork does not allow maintainer edits, so the review fixes land here on top of it.