GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” ๐Ÿ“ docs(testing): show directory isolation in spawned workers by gaborbernat ยท Pull Request #754 ยท tox-dev/platformdirs

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Nov 27, 2026

Copy link
Copy Markdown
Member

platformdirs.testing.isolated_dirs redirects 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 runnable ProcessPoolExecutor example: the parent passes a root as the task argument, the worker enters isolated_dirs with 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
PriyansuMaurya and others added 2 commits November 26, 2026 00:40
@PriyansuMaurya
docs: explain directory isolation in spawned workers
e0f8956
Add an executable process-pool example and a spawned-process test covering independent child paths, explicit child isolation, file placement and restoration.
@gaborbernat
๐Ÿงช test: tighten spawned worker docs and test
789ce2d
@gaborbernat
gaborbernat requested a review from ofek as a code owner November 27, 2026 20:25
@gaborbernat gaborbernat added the documentation Improvements or additions to documentation label Nov 27, 2026
@gaborbernat gaborbernat mentioned this pull request Nov 27, 2026
๐Ÿ“ docs(testing): show directory isolation in spawned workers #751
Closed
@gaborbernat
gaborbernat merged commit 8d53073 into tox-dev:main Nov 27, 2026
40 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ofek ofek Awaiting requested review from ofek ofek is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

documentation Improvements or additions to documentation

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@gaborbernat @PriyansuMaurya
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.
You are visitor 01402775 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.