Skip to content

dumps with WM_PRETTY not indented by 4 spaces when keys are int #191

Description

@jamesbraza

With python-rapidjson==1.12:

import rapidjson

data = {1: "hi"}
rapidjson.dumps(str(data), write_mode=rapidjson.WM_PRETTY)

I expect it to print:

{
    1: "hi"
}

However, it prints:

"{1: \'hi\'}"

Is this a bug, or is this just expected behavior when keys are int?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions