fix(build): avoid SIGPIPE exits and ruff E731 failure
CI / CI configuration security checks (push) Successful in 2s
CI / Capabilities and shell quality (push) Successful in 14s
CI / Python tests and compilation (push) Successful in 31s
CI / QMD unit tests (push) Successful in 7s
CI / Build and inspect generated packages (push) Successful in 19s
CI / PowerShell tests on Ubuntu (push) Failing after 1m7s
CI / Bash integration and installation guards (push) Failing after 17s
CI / Installed client configuration smoke tests (push) Successful in 33s

Piping sed/grep into `head -n 1` under `set -o pipefail` could kill the
writer with SIGPIPE and abort build.sh with exit 141. Quit inside
sed/awk instead. Rewrite the rmtree retry lambda as a def for ruff E731.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Julian LechnerandClaude Opus 5.5 committed 2026-11-19 14:36:59 +01:00
1 parent c3e22eb902
commit bdf32bb6bd
2 files changed
+9 -5

No files matched your search

+4 -1
View File
@@ -355,7 +355,10 @@ class Manager:
print(f'WARN Preserving {record["directory"]}: it holds local files ({len(local)}); delete it yourself if they are not needed.')
return
# Git marks pack files read-only, which Windows refuses to delete.
retry = lambda _, path, __: (os.chmod(path, stat.S_IWRITE), os.unlink(path))
def retry(_, path, __):
os.chmod(path, stat.S_IWRITE)
os.unlink(path)
shutil.rmtree(directory, **({'onexc': retry} if sys.version_info >= (3, 12) else {'onerror': retry}))
elif record['kind'] == 'mcp':
self.command(['mcporter', '--config', str(self.home / '.mcporter/mcporter.json'), 'config', 'remove', record['server']])