Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

🐛 ub-needs-exchange: NaN, Infinity and lone surrogates are read although they are not JSON

Open
#2,232 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
json, python
Domain
data

Research direction

The issue names the reader's use of Python's json.loads and its parse_constant hook, which is where NaN, Infinity and -Infinity could be rejected with invalid_json. Read the RFC 8259 contract section (§2.3) and the reviews in #2219 first, since the lone-surrogate behaviour still needs a maintainer decision. Done means the three constants and lone surrogates are rejected, each has a corpus case, and changelog lines are added for the package and sphinx-needs.

Written by the indexing model from the issue text.

Description

bug pkg: ub-needs-exchange

The reader accepts NaN, Infinity and -Infinity (Python's json reads them by default) and lone surrogate escapes, none of which is JSON (RFC 8259); a strict reader such as serde_json refuses them as a syntax error. The 1.0.0 contract records this as "out of contract" (§2.3) rather than fixing it, since the slice changed no behaviour.

Candidate fix: json.loads(text, parse_constant=…) raising invalid_json for the three constants, a decision on lone surrogates, and a corpus case for each — a behaviour change that needs a changelog line in the package and in sphinx-needs.

Found by the 1.0.0 build's reviews (#2219; A-2 / B-1).

Dominant language
Python
Stars
309
Forks
103
Avg merge
10h 41m
Merged PRs (30d)
128

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from useblocks/sphinx-needs

All issues in useblocks/sphinx-needs

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.