Skip to content

Restore Windows double-decode for --execute_str#69

Merged
JE-Chen merged 1 commit intomainfrom
dev
Apr 28, 2026
Merged

Restore Windows double-decode for --execute_str#69
JE-Chen merged 1 commit intomainfrom
dev

Conversation

@JE-Chen
Copy link
Copy Markdown
Member

@JE-Chen JE-Chen commented Apr 28, 2026

Summary

  • PyBreeze (and other launchers) double-encode the action list on Windows to survive command-line escaping. The registry refactor dropped the matching peel step in _execute_str, so python -m automation_file --execute_str <payload> rejected PyBreeze's payload with action_list must be list, got str.
  • _execute_str now unwraps a second JSON layer when the first decode yields a string. Guarded by isinstance(parsed, str) so single-encoded payloads work too — no platform check, same behaviour everywhere.
  • Adds two tests (tests/test_cli_main.py) covering the single- and double-encoded payload shapes.

Test plan

  • pytest tests/test_cli_main.py — 4/4 pass
  • Full suite: 743 passed (16 deselected = optional pyarrow parquet path, unrelated)
  • End-to-end subprocess.Popen([..., "-m", "automation_file", "--execute_str", json.dumps(json.dumps(actions))]) — RC 0, target file written
  • ruff check / ruff format --check clean on changed files

PyBreeze double-encodes the action list on Windows to survive command-line
escaping; the registry refactor dropped the matching peel step, so the CLI
saw a string and rejected the batch. Restore the unwrap with an
isinstance(parsed, str) guard so single- and double-encoded payloads both
work cross-platform. Cover both shapes in tests/test_cli_main.py.
@sonarqubecloud
Copy link
Copy Markdown

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity · 0 duplication

Metric Results
Complexity 4
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant