Skip to content

indent=1 prevents saving files with a single number #107

Description

@sam-s

When saving a number of a file with indent=1, nothing is written:

>>> rapidjson.dumps(100,indent=1)
'100'

however

with open("zzz","w") as fd:
    rapidjson.dump(100,fd,indent=1)

creates an empty file zzz.

Note that

with open("zzz","w") as fd:
    rapidjson.dump(100,fd)

and

with open("zzz","w") as fd:
    rapidjson.dump([100],fd,indent=1)

work correctly as expected.

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