Commit graph

133 commits

Author SHA1 Message Date
Miss Islington (bot)
aab69a8214
[3.12] gh-132021: Add bool type to the list of allowed JSON key types (GH-132048) (#132256)
gh-132021: Add bool type to the list of allowed JSON key types (GH-132048)
(cherry picked from commit 403886c28d)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <thatiparthysreenivas@gmail.com>
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2025-04-08 08:43:45 +00:00
Miss Islington (bot)
e903b8ad13
[3.12] gh-87506: Document that json.load*() can raise UnicodeDecodeError (GH-127355) (#128608)
(cherry picked from commit 15372d0112)
(cherry picked from commit cdfb8bc93a)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <thatiparthysreenivas@gmail.com>
Co-authored-by: Erlend Aasland <erlend@python.org>
2025-01-08 08:51:19 +00:00
Miss Islington (bot)
82b061d711
[3.12] Docs: mark up json.load() using parameter list (GH-128488) (#128597)
(cherry picked from commit a21e31ec54)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2025-01-07 21:14:50 +00:00
Miss Islington (bot)
e3e4852fe0
[3.12] Docs: amend json.dump() post gh-128482 (GH-128489) (#128494)
(cherry picked from commit 87ee76062a)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2025-01-04 19:04:13 +00:00
Miss Islington (bot)
731fc4052c
[3.12] Docs: mark up json.dump() using parameter list (GH-128482) (#128487)
(cherry picked from commit a0088b40bb)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-01-04 15:50:55 +00:00
Miss Islington (bot)
92bc714033
[3.12] GH-103484: Fix permanently redirects reported by linkcheck (GH-124144) (GH-124152)
Fix redirects reported by linkcheck, update docs conf.py checks.
(cherry picked from commit 0a32c6959c)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-09-16 20:53:46 -07:00
Miss Islington (bot)
c3a866c915
[3.12] gh-123392: Clarify wording regarding parameters that are functions to be called (GH-123394) (GH-123665)
(cherry picked from commit c08ede2714)

Co-authored-by: ryan-duve <ryan-duve@users.noreply.github.com>
2024-09-05 12:50:00 +02:00
Miss Islington (bot)
b83b3cb9da
[3.12] docs: module page titles should not start with a link to themselves (GH-117099) (#118791)
docs: module page titles should not start with a link to themselves (GH-117099)
(cherry picked from commit bcb435ee8f)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-05-08 19:42:01 +00:00
Miss Islington (bot)
9df6d1e033
[3.12] doc: Use super() in subclassed JSONEncoder examples (GH-115565) (GH-116047)
doc: Use super() in subclassed JSONEncoder examples (GH-115565)

Replace calls to `json.JSONEncoder.default(self, obj)`
by `super().default(obj)` within the examples of the documentation.
(cherry picked from commit 647053fed1)

Co-authored-by: Jan Max Meyer <jmm@phorward.de>
2024-02-28 14:13:08 +00:00
Adam Turner
4c0f42bbc6
[3.12] Docs: Avoid the deprecated `.. cmdoption::` directive (GH-110292) (#110302)
[3.12] Docs: Avoid the deprecated ``.. cmdoption::`` directive (GH-110292).
(cherry picked from commit 77e9aae383)
2023-10-03 20:55:29 +03:00
Serhiy Storchaka
d514e1439f
[3.12] gh-101100: Sphinx warnings: pick the low hanging fruits (GH-107386) (GH-107419)
(cherry picked from commit f2d07d3289)
2023-07-29 09:16:27 +03:00
Serhiy Storchaka
ffc7678f46
[3.12] gh-106892: Use roles :data: and :const: for referencing module variables (GH-106894) (GH-106954)
(cherry picked from commit d036db728e)
2023-07-21 14:51:00 +03:00
Miss Islington (bot)
1acfecbc00
[3.12] Revert "GH-96145: Add AttrDict to JSON module for use with object_hook (GH-96146)" (GH-105948) (#106117)
Revert "GH-96145: Add AttrDict to JSON module for use with object_hook (GH-96146)" (GH-105948)

This reverts commit 1f0eafa844.
(cherry picked from commit d3af83b934)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2023-06-26 21:11:49 +02:00
Miss Islington (bot)
b328ba1941
[3.12] Fix indentation in json.AttrDict REPL example (GH-104930) (#104931)
Fix indentation in `json.AttrDict` REPL example (GH-104930)

This is causing the docs to be rendered incorrectly.
(cherry picked from commit 38539ef126)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-25 14:16:20 +01:00
Miss Islington (bot)
4833f621b3
[3.12] Misc updates to Whatsnew 3.12 (GH-104912) (GH-104915) 2023-05-24 21:14:11 -05:00
Serhiy Storchaka
dd53b79de0
gh-96959: Update more HTTP links (GH-97536)
Use HTTPS for documents which are available by both HTTP and HTTPS
links, but there is no redirection from HTTP to HTTPS or vice versa.
2022-09-27 14:08:11 +03:00
Gregory P. Smith
34de67c094
gh-96512: Update int_max_str docs to say 3.11 (#96942)
It was unknown if it'd be before 3.11.0 when creating the original
changes.  It's in 3.11rc2, so 3.11 it is.
2022-09-19 16:43:11 -07:00
Gregory P. Smith
511ca94520
gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96499)
Integer to and from text conversions via CPython's bignum `int` type is not safe against denial of service attacks due to malicious input. Very large input strings with hundred thousands of digits can consume several CPU seconds.

This PR comes fresh from a pile of work done in our private PSRT security response team repo.

Signed-off-by: Christian Heimes [Red Hat] <christian@python.org>
Tons-of-polishing-up-by: Gregory P. Smith [Google] <greg@krypto.org>
Reviews via the private PSRT repo via many others (see the NEWS entry in the PR).

<!-- gh-issue-number: gh-95778 -->
* Issue: gh-95778
<!-- /gh-issue-number -->

I wrote up [a one pager for the release managers](https://docs.google.com/document/d/1KjuF_aXlzPUxTK4BMgezGJ2Pn7uevfX7g0_mvgHlL7Y/edit#). Much of that text wound up in the Issue. Backports PRs already exist. See the issue for links.
2022-09-02 09:35:08 -07:00
Raymond Hettinger
1f0eafa844
GH-96145: Add AttrDict to JSON module for use with object_hook (#96146) 2022-08-23 16:22:00 -05:00
Serhiy Storchaka
f79547a429
gh-91838: Use HTTPS links in docs for resources which redirect to HTTPS (GH-95527)
If an HTTP link is redirected to a same looking HTTPS link, the latter can
be used directly without changes in readability and behavior.
It protects from a men-in-the-middle attack.

This change does not affect Python examples.
2022-08-04 10:13:49 +03:00
Alex Waygood
bc098cfdb7
gh-92417: json docs: dict is ordered on all supported Python versions (GH-92422) 2022-05-08 16:16:52 +03:00
Kumar Aditya
71ef0b4c2b
bpo-46157: fix typo in docs (GH-30237) 2021-12-23 11:17:31 +02:00
James Gerity
8db06528ca
bpo-46001: Change OverflowError to RecursionError in JSON library docstrings (GH-29943) 2021-12-07 11:58:40 +02:00
180909
b37dc9b3bc
bpo-45441: Update some moved URLs in documentation (GH-28861) 2021-10-12 13:36:14 +03:00
Adorilson Bezerra
a347bc0b35
Doc: Improve library/json document. (GH-24390) 2021-03-02 10:51:58 +09:00
Mathieu Dupuy
12695f4c6d
Doc: add a missing period (GH-21819) 2020-08-20 22:08:37 +02:00
Inada Naoki
5bbac8cbdf
bpo-39377: json: Update doc about the encoding option. (GH-18076)
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2020-01-22 19:01:24 +09:00
Daniel Himmelstein
15fb7fa881 bpo-29636: json.tool: Add document for indentation options. (GH-17482)
And updated test to use subprocess.run
2019-12-07 23:14:40 +09:00
wim glenn
efefe25443 bpo-27413: json.tool: Add --no-ensure-ascii option. (GH-17472) 2019-12-06 15:44:01 +09:00
Andre Delfino
d288b29fc6 Correct minor grammar mistake (GH-15404) 2019-08-23 10:58:27 +01:00
Raymond Hettinger
657008ea03
bpo-30550: Clarify JSON ordering guarantees (GH-15397) 2019-08-22 15:14:42 -07:00
Matthias Bussonnier
a8abe097c1 bpo-33461: emit DeprecationWarning when json.loads(encoding=...) is used (GH-6762) 2019-04-09 16:17:25 +09:00
HongWeipeng
f194479949 bpo-31553: add --json-lines option to json.tool (#10051)
* add jsonlines option to json.tool

* code review

* fix:avoid read infile after it close

* improve doc in whatsnew 3.8
2018-11-07 12:09:32 +02:00
Serhiy Storchaka
083a7a172b
bpo-35167: Specify program for gzip and json.tool command line options. (GH-10332) 2018-11-05 17:47:27 +02:00
Evan Allrich
9e84084851 bpo-34379: Doc: Move note for json.dump (GH-8730) 2018-08-11 16:34:02 +09:00
Anthony Sottile
bb6366bd75 bpo-17909: Document that json.load can accept a binary IO (GH-7366) 2018-06-07 18:58:12 +09:00
Serhiy Storchaka
46936d5a71
Improve highlighting of some code blocks. (GH-6401) 2018-04-08 19:18:04 +03:00
INADA Naoki
629338f140
bpo-32360: Remove object_pairs_hook=OrderedDict examples (GH-5001) 2018-04-03 12:39:47 +09:00
Sergey Fedoseev
a7fbad96c8 Make json.dumps() example to be PEP-8 compliant. (GH-3472) 2017-09-09 09:39:36 -07:00
Serhiy Storchaka
5becf38a03 Fix the signature of JSONDecodeError (no end parameter). (#1827)
Unlikely to the simplejson module, json.JSONDecodeError doesn't accept the end argument.
2017-05-27 16:11:18 +03:00
Martin Panter
574ff0680f Issues #29189: Merge indentation fixes from 3.5 2017-01-24 00:29:11 +00:00
Martin Panter
ef107ee7a0 Issue #29189: Fix indentation in RST markup 2017-01-24 00:26:56 +00:00
Raymond Hettinger
a57a8a3e2d Issue #29281: Fill-in a missing versionchanged entry 2017-01-19 21:39:37 -08:00
Serhiy Storchaka
c7b1a0bbe2 Issue #28763: Use double hyphens (rendered as en-dashes) in numerical ranges
in the documentation.
2016-11-26 13:43:28 +02:00
Serhiy Storchaka
0264e46caa Issue #28763: Use double hyphens (rendered as en-dashes) in numerical ranges
in the documentation.
2016-11-26 13:49:59 +02:00
Serhiy Storchaka
58d3e54556 Fixed the documentation of parse_constant argument in json.load().
parse_constant doesn't get called on 'null', 'true', 'false' since 3.1/2.7.
2016-11-12 22:48:33 +02:00
Serhiy Storchaka
022371ff94 Fixed the documentation of parse_constant argument in json.load().
parse_constant doesn't get called on 'null', 'true', 'false' since 3.1/2.7.
2016-11-12 22:47:16 +02:00
Serhiy Storchaka
989db5c880 Issue #19795: Mark up None as literal text. 2016-10-19 16:37:13 +03:00
Serhiy Storchaka
ecf41da83e Issue #19795: Mark up None as literal text. 2016-10-19 16:29:26 +03:00
Nick Coghlan
b161562f72 Issue #17909: Accept binary input in json.loads
json.loads (and hence json.load) now support binary input
encoded as UTF-8, UTF-16 or UTF-32.

Patch by Serhiy Storchaka.
2016-09-10 20:16:18 +10:00