borgmatic list --json doesn't output valid json #276
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#276
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
I want to parse the output of
borgmatic list --json
.Steps to reproduce (if a bug)
borgmatic list --json
Actual behavior (if a bug)
borgmatic list --json | jq .
givesparse error: Invalid numeric literal at line 1, column 860
borgmatic list --json | cat -A
shows"}}]^[[0m
at the endExpected behavior (if a bug)
borgmatic list --json
should output valid jsonEnvironment
borgmatic version: 1.4.21
borgmatic installation method: installed as python package using pipx
Borg version: 1.1.10-2 (installed as debian package)
Python version: 3.7.5
operating system and version: Ubuntu 19.10
Etc
While creating this issue I realized that downgrading to 1.4.15 fixes this.
So it's some kind of regression between 1.4.15 and 1.4.21
Thanks for reporting this, and for including the helpful reproduction steps! I'm able to see the exact same behavior on my system.
This is fixed in master! The problem was that the coloring of log output was screwing with the JSON. Now, using
--json
automatically disables colored output. I'll post an update here when this fix is released. Thanks again.Okay, this is now released in borgmatic 1.4.22!