Skip to content

docs(examples): fix invalid python one-liner in with-features canary#144

Merged
pofallon merged 1 commit into
mainfrom
docs/fix-with-features-canary-python
May 29, 2026
Merged

docs(examples): fix invalid python one-liner in with-features canary#144
pofallon merged 1 commit into
mainfrom
docs/fix-with-features-canary-python

Conversation

@pofallon
Copy link
Copy Markdown
Contributor

Summary

examples/up/with-features/exec.sh's extract_container_id passed an invalid python3 -c program: if/try compound statements joined with semicolons (if lines:; try:; …), which raises SyntaxError. It also assumed line-delimited JSON, but deacon up prints a single pretty-printed JSON document.

Fix

Replace it with a valid one-liner that parses the whole stdout as one JSON document and reads containerId. On any parse error python exits non-zero and the existing || json_out="" falls back to docker label discovery.

Testing

  • with-features canary now runs all three scenarios with no SyntaxError, exit 0.

Docs/examples only.

🤖 Generated with Claude Code

The `extract_container_id` helper passed an invalid `python3 -c` program —
`if`/`try` compound statements joined with semicolons (`if lines:; try:; …`),
which raises `SyntaxError`, and it also assumed line-delimited JSON when
`deacon up` prints a single pretty-printed JSON document.

Replace it with a valid one-liner that parses the whole stdout as one JSON
document and reads `containerId`; on any parse error python exits non-zero and
the existing `|| json_out=""` falls back to docker label discovery.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the docs Documentation changes label May 29, 2026
@pofallon pofallon merged commit 0e2b95c into main May 29, 2026
10 checks passed
@pofallon pofallon deleted the docs/fix-with-features-canary-python branch May 29, 2026 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant