← Back to issue list

Pulling local sources is rather broken

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1558446
Type
issue
State
closed
Author
~sergiusens
Labels
Created
Updated
Closed

Current evaluation

Fixed a local source pull failure caused by os.path.isdir returning true for symlinks, which made os.rmdir fail. The directory check was inverted to correctly handle symlinks and regular files.

Suggested action:

No scores available.

Issue body

When pulling a local source we check if there's a dir there, most likely created by the plugin handler, and we os.rmdir it; else we do a os.remove. The problem is that the call to isdir upon the symlink will be true and os.rmdir will fail so we invert this.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Fixed a local source pull failure caused by os.path.isdir returning true for symlinks, which made os.rmdir fail. The directory check was inverted to correctly handle symlinks and regular files.
qwen/qwen3.6-35b-a3b Fixed by inverting the directory check logic. The original code failed when pulling local sources because os.path.isdir returned true for symlinks, causing os.rmdir to error. The updated check correctly handles symlinks.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#377 Correct local source pulling snapcraft merged Merged fix for local source pulling that incorrectly followed symlinks, causing rmdir failures and duplicate pull errors. The change inverts the directory check, adds explicit symlink validation, and improves error handling. Approved by @zyga. Resolves LP: #1558446.
79%