borgmatic list with --json should not use color escape characters #285
Labels
No labels
blocked
breaking
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#285
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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
using borgmatic list --json to send data to an api got a return:
{"message":"Unexpected token \u001b in JSON at position 10676"}
Steps to reproduce (if a bug)
using command from above to send data with curl to an api
curl -X POST $URL -H 'Content-Type: application/json' -d "$(borgmatic list --json)"Actual behavior (if a bug)
return message:
{"message":"Unexpected token \u001b in JSON at position 10676"}
Expected behavior (if a bug)
should give an ok.
Other notes / implementation ideas
it seems since there is no color on the json, but it still append some escape characters to end coloring.
as a workaround i can use
borgmatic -nc list --jsonbut i think it is wrong to append escape characters in case of
--jsonwhere no coloring is used.Environment
borgmatic version: 1.4.21
borgmatic installation method: pip install
Borg version: borg 1.1.10
Python version: Python 3.6.9
operating system and version: Ubuntu 18.04.3 LTS
Thank you for reporting this! The good news is that this is already fixed in master, so I'll cut a release soon and post here when it's out.
Okay, this is now released in borgmatic 1.4.22!