Skip to content

Right parenthesis missing in Lib/json/__init__.py (all recent releases) #93775

@williamdavid900

Description

@williamdavid900

Python 3.10.5 and previous releases

Line 293 in /Lib/json/__init__.py is missing a right parenthesis before the ending comma (see the details below). This happens in previous releases of Python as well.

$python3
Python 3.10.5 (main, Jun 11 2022, 16:53:24) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import json
json.load(open('/mnt/c/example/example.json'))
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.10/json/__init__.py", line 293, in load
return loads(fp.read(),

File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 33 column 17 (char 574)

The specific problem in line 293 in Lib/json/__init.__py has been narrowed down here:
File "/usr/lib/python3.10/json/__init__.py", line 293, in load
return loads(fp.read(),

Line 293 is missing a right parenthesis before the ending comma (see the line immediately above this one). The problem also shows up in previous releases of Python.

Hope this helps,
Bill

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions