Skip to content

Positive infinity with an explicit plus is not parsed correctly #63

Closed

Description

@pavel-kirienko
>>> import json5  # v0.9.11

>>> json5.loads('Infinity')  # Correct.
inf

>>> json5.loads('-Infinity')  # Correct.
-inf

>>> json5.loads('+123.456')  # Correct.
123.456

>>> json5.loads('+Infinity')  # Non-spec behavior, incorrect; expected inf.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "~/.local/lib/python3.10/site-packages/json5/lib.py", line 81, in loads
    raise ValueError(err)
ValueError: <string>:1 Unexpected "I" at column 2
<string>:1 Unexpected "I" at column 2

Activity

  1. dpranke commented on Apr 23, 2023

    @dpranke
    Owner

    Hi! Thanks for reporting this and I apologize for the delay in getting back to you. I will try get to this soon.

  2. added a commit that references this issue on May 15, 2023
  3. dpranke commented on May 15, 2023

    @dpranke
    Owner

    Fixed in ff2a072.

    Thanks again for filing the bug and sorry again for me not getting to it before now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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