← Back to issue list

pluginhandler: don't clobber path on local import failure

View original Github issue

Metadata

Project
snapcraft
Number
#1361
Type
pull request
State
merged
Author
zyga
Labels
Created
Updated
Closed

Current evaluation

Merged fix preventing sys.path clobbering on local plugin import failure. Implemented a try/finally block to restore the path. Approved by two reviewers and passed CI.

Suggested action:

No scores available.

Issue body

The helper for importing local plugins would clobber sys.path if the import failed. This is fixed with a simple try/finally statement. Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged fix preventing sys.path clobbering on local plugin import failure. Implemented a try/finally block to restore the path. Approved by two reviewers and passed CI.
qwen3.6-35b-a3b-mtp-q6 Merged a fix preventing local plugin import failures from clobbering sys.path. The change uses a try/finally block to restore the path on error, approved after a regression test assertion was added.
qwen3.6-35b-a3b-mtp-q6 Merged fix preventing local plugin import failures from clobbering sys.path. A try/finally block now preserves the path on error, validated by a new assertion.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#392 plugins: fix pip path in python plugin craft-parts merged Merged a fix ensuring the python plugin uses the venv pip path, preventing unintended package installations when PATH changes. Approved by one reviewer, passed CI checks, and modified five files.
71%