Repository navigation
🐛 fix(subprocess): keep PYTHONPATH when backend-path is set - #375
Merged
gaborbernat merged 1 commit intoNov 18, 2026
Merged
Conversation
SubprocessFrontend replaced PYTHONPATH with the backend-path entries, so an in-tree backend could no longer import anything the caller provided through PYTHONPATH and failed to start with ModuleNotFoundError. The backend-path entries now go in front of the existing value instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #374.
SubprocessFrontendsetPYTHONPATHto thebackend-pathentries and discarded the caller's value. An in-tree backendthen could not import anything that was only reachable through
PYTHONPATH, and the backend failed to start withModuleNotFoundError. Thebackend-pathentries now go in front of the existingPYTHONPATH. That keeps the PEP 517order (in-tree paths first) and leaves the caller's paths importable after them. Without
backend-path, nothing changes.Tests:
test_backend_path_keeps_existing_pythonpathputs ahelpermodule onPYTHONPATHthat the in-tree backendimports. The same directory also holds a decoy module with the backend's name, so the test fails if
PYTHONPATHeverends up ahead of
backend-path. The test fails onmainwithModuleNotFoundError: No module named 'helper'andpasses with this change.
demo-1.0.tar.gzwith this change.both before and after, because this account cannot create symlinks.
🤖 Generated with Claude Code