Skip to content

fix: wpprobe json parsing error - #1212

Open
ocervell wants to merge 2 commits into
mainfrom
claude/issue-1207-20260622-2149
Open

fix: wpprobe json parsing error#1212
ocervell wants to merge 2 commits into
mainfrom
claude/issue-1207-20260622-2149

Conversation

@ocervell

@ocervell ocervell commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Fix wpprobe crashing with yaml.parser.ParserError when parsing JSON output.

The on_cmd_done method was using yaml.safe_load() to read the wpprobe output file, but wpprobe outputs JSON. Replaced with json.load() and removed the unused yaml import.

Fixes #1207

Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Updated internal data handling for improved compatibility and maintainability.

wpprobe outputs JSON but on_cmd_done was parsing it with yaml.safe_load,
causing a ParserError when the file contained JSON objects.

Co-authored-by: Olivier Cervello <ocervell@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a0aa0f9-4e18-4e6d-b5ba-5906bd6117c6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

In secator/tasks/wpprobe.py, the yaml import is replaced with json, and the result-loading call in on_cmd_done is changed from yaml.safe_load(f.read()) to json.load(f). No other logic is altered.

Changes

wpprobe JSON parsing fix

Layer / File(s) Summary
Replace YAML loader with JSON in wpprobe
secator/tasks/wpprobe.py
Import swapped from yaml to json; on_cmd_done now calls json.load(f) instead of yaml.safe_load(f.read()) to parse the saved wpprobe output file.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • freelabz/secator#947: Also modifies wpprobe.py's on_cmd_done result-parsing logic, refactoring how the JSON output from wpprobe is processed downstream.

Poem

🐇 A YAML doc walked in, then fell on its face,
JSON said "move over, I'll take your place!"
safe_load packed its bags with a sigh,
json.load stepped up, held its head high.
Two lines changed — the parser hops free! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: fixing wpprobe's JSON parsing by switching from YAML to JSON deserialization.
Linked Issues check ✅ Passed The PR directly addresses issue #1207 by replacing yaml.safe_load() with json.load() to fix the parser error when parsing JSON output.
Out of Scope Changes check ✅ Passed All changes are in-scope: only the wpprobe.py file was modified to fix the parsing logic and update imports as necessary.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-1207-20260622-2149

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ocervell ocervell added status-needs-testing status-needs-human Needs a human design decision / validation before merge labels Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status-needs-human Needs a human design decision / validation before merge status-needs-testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: wpprobe issue

1 participant