Skip to content

How to avoid escaping for an already escaped string in .dump() #2870

@BrandonLiang

Description

@BrandonLiang

As titled.

i have the following mapping in the json object:
obj[“text”] = “\”some text\nanother text\””

now, if i do obj.dump(), it will double escape -> “\\\”some text\\nanother text\\\”” due to the default escaping.

i wonder if anyone else has run into this issue and how you resolve it. Thanks!

(As a side not, i would like to see an update to include an optional bool param to turn off the default escape option for .dump().)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions