gh-118359: Improve docs for Bdb.user_call (GH-118368)
The `argument_list` parameter of bdb.Bdb.user_call has been useless for 25 years. It is retained for backwards compatibility, but it will always be None.
(cherry picked from commit 8e4fb5d260)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
gh-118235: Skip RAISE_SYNTAX_ERROR rules in the grammar spec (GH-118237)
(cherry picked from commit ef940dec40)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
* GH-113171: Fix "private" (non-global) IP address ranges (GH-113179)
The _private_networks variables, used by various is_private
implementations, were missing some ranges and at the same time had
overly strict ranges (where there are more specific ranges considered
globally reachable by the IANA registries).
This patch updates the ranges with what was missing or otherwise
incorrect.
100.64.0.0/10 is left alone, for now, as it's been made special in [1].
The _address_exclude_many() call returns 8 networks for IPv4, 121
networks for IPv6.
[1] https://github.com/python/cpython/issues/61602
* GH-65056: Improve the IP address' is_global/is_private documentation (GH-113186)
It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).
(cherry picked from commit 2a4cbf17af)
(cherry picked from commit 40d75c2b7f)
---------
Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
* gh-59215: unittest: restore _top_level_dir at end of discovery (GH-15242)
(cherry picked from commit fc5f68e58e)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Docs: replace Harry Potter reference with Monty Python (GH-118130)
(cherry picked from commit 1446024124)
Co-authored-by: Clément Robert <cr52@protonmail.com>
gh-118100: Improve links in `ast.rst` (GH-118101)
(cherry picked from commit 2aa11cca11)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-87969: Align docs and docstrings with implementation for ctypes' [w]string_at() (GH-25384)
The implementation uses 'ptr' for the name of the first parameter of
ctypes.string_at() and ctypes.wstring_at(). Align docs and docstrings
with the naming used in the implementation.
(cherry picked from commit 81a926bd20)
Co-authored-by: Shreyan Avigyan <shreyan.avigyan@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
gh-116935: Document that heap types need to support garbage collection (GH-118021)
(cherry picked from commit 5d54436574)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
gh-117518: Clarify PyTuple_GetItem() borrowed reference in the doc (GH-117920)
(cherry picked from commit 4605a197bd)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-64588: Clarify the difference between mu and xbar in statistics docs (GH-117333)
Thanks Davin Potts for the clarification idea.
(cherry picked from commit fefd5d9711)
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Use "Contributed by" in a couple of occurrences of 3.12 whatsnew (GH-118070)
(cherry picked from commit 398abdd6fa)
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
gh-116932: Add note on how to report python documentation theme bugs (GH-117989)
(cherry picked from commit 468b9aeb92)
Co-authored-by: lyc8503 <me@lyc8503.site>
gh-114539: Clarify implicit launching of shells by subprocess (GH-117996)
(cherry picked from commit a4b44d39cd)
Co-authored-by: Steve Dower <steve.dower@python.org>
Docs: Add classes to C API return value annotations (GH-117926)
(cherry picked from commit 3284b84c43)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Simpler example of shallow dict export of a dataclass (GH-117812)
(cherry picked from commit f303651b45)
Co-authored-by: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com>
I think the choice of wording in these docs is great and doesn't
need to change. However, it could be useful to explicitly define
this term / the cost of doing so seems relatively low.
(cherry picked from commit 37a4cbd872)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
gh-104269: Document `glob.glob` duplicates when using multiple `**` patterns (GH-105406)
(cherry picked from commit c06be6bbb8)
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
* remove load extension doctest since we cannot skip it conditionally
* remove sys.unraisablehook example; using unraisable hooks is not "an
improved debug experience"
(cherry picked from commit e338e1a4ec)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Remove all temporary databases in a dedicated 'testcleanup' step
at the end of the file.
(cherry picked from commit a453f5ef9d)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-117074: Update Traversable.joinpath docs to the 3.11+ protocol (GH-117113)
(cherry picked from commit e569f9132b)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-75988: Fix issues with autospec ignoring wrapped object (#115223)
* set default return value of functional types as _mock_return_value
* added test of wrapping child attributes
* added backward compatibility with explicit return
* added docs on the order of precedence
* added test to check default return_value
(cherry picked from commit 735fc2cbbc)
Define 'nonlocal scopes' in a way that excludes class scopes.
Rearrange the rest of the doc. Add "Programmer's note".
(cherry picked from commit 025ef7a5f7)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Update titles and subtitles on landing page template (GH-116914)
* Update titles and subtitles on landing page template
* address review from gvanrossum
* Edits from hugovk review
* Change word order back. Down the road we should split license and history
(cherry picked from commit c514a975ab)
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
In Lexical Analysis f-strings section, NULL in the description
of 'literal character' means '\0'. In the format_spec grammar
production, it is wrong with that meaning and redundant if
instead interpreted as <nothing>. Remove it there.
(cherry picked from commit 4e45c6c54a)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
It is confusing, because libc is not imported from ctypes,
but defined in previous examples, which already contain the import.
(cherry picked from commit 744c077795)
Co-authored-by: jnchen <caojingchen@live.com>
* Fix the description of the "-b" option.
* Add references to environment variables for "-s" and "-X dev" options.
(cherry picked from commit 33662d4e01)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
There now may be multiple carets pointing at a token
rather than just a character. Fix the sentence about
possible causes.
(cherry picked from commit 3e45030076)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
GH-116218 Docs: Add availability information for the 'resource' module (GH-116256)
Add availability data to 'resource' module Docs
(cherry picked from commit 03f86b1b62)
Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
(cherry picked from commit 601f3a7b33)
Co-authored-by: Nicolas A. Oyarzabal <79150521+nicky-eng@users.noreply.github.com>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Allow controlling Expat >=2.6.0 reparse deferral (CVE-2023-52425) by adding five new methods:
- `xml.etree.ElementTree.XMLParser.flush`
- `xml.etree.ElementTree.XMLPullParser.flush`
- `xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`
- `xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`
- `xml.sax.expatreader.ExpatParser.flush`
Based on the "flush" idea from https://github.com/python/cpython/pull/115138#issuecomment-1932444270 .
- Please treat as a security fix related to CVE-2023-52425.
(cherry picked from commit 6a95676bb5)
(cherry picked from commit 73807eb634)
(cherry picked from commit eda2963378)
---------
Includes code suggested-by: Snild Dolkow <snild@sony.com>
and by core dev Serhiy Storchaka.
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Amend wording after gh-116019 was merged.
(cherry picked from commit e205c5cd8f)
Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
closure is not a function pointer, it is a user data pointer.
(cherry picked from commit df59401108)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-116281: Remove wrong '\' from '\*' in some doc signatures (GH-116282)
(cherry picked from commit 4859ecb860)
Co-authored-by: HarryLHW <123lhw321@gmail.com>
This mostly restores information removed in c12240ed28 (GH-114749).
(cherry picked from commit 05b04903a1)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Fix rendering of null character in ast.rst (GH-116080)
(cherry picked from commit c04a981ff4)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
GH-115986 Reorder pprint docs and amend some references (GH-116019)
Introduce a new subsubsection, 'Functions', for module level functions,
and place it before the PrettyPrinter class reference.
Also:
- Fix pprint.pprint() references so they properly link to the module
level function.
- Add links to sys.stdout.
(cherry picked from commit 6c1c94dc51)
Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
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>
Remove a left-over sentence that refers to an example that was present in Python 3.10 and was using ``Py_OptimizeFlag``.
(cherry picked from commit 915d7dd090)
Co-authored-by: Antti Haapala <antti.haapala@interjektio.fi>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* clean up fcntl module doc
* simplify
* a few changes, based on suggestion by CAM-Gerlach
* nitpick ignore for a couple other C functions mentioned in the fcntl module doc
* more changes, especially related to LOCK_* constants
* :data: back to :const:
* Apply suggestions from code review
---------
(cherry picked from commit 84a275c4a2)
Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Arguments to enterabs() are specified as Unix time.
If the scheduler use the time.monotonic timer, the code will take
decades to complete.
(cherry picked from commit cb287d3421)
Co-authored-by: mauricelambert <50479118+mauricelambert@users.noreply.github.com>
Added to repr entry in Doc/library/functions.rst.
---------
(cherry picked from commit 5770006ffa)
Co-authored-by: Oh seungmin <tmdals179@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Thanks to Pedro Arthur Duarte (pedroarthur.jedi at gmail.com) for help with this bug.
(cherry picked from commit f7455864f2)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
gh-89480: Document the gdb helpers (GH-115657)
Content adapted from https://devguide.python.org/development-tools/gdb/GH-
and https://wiki.python.org/moin/DebuggingWithGdb.
The original content on the Wiki page came from gdb debug help used by
the Launchpad (https://launchpad.net/) team.
Thanks to Anatoly Techtonik and user `rmf` for substantial improvements to the Wiki page.
The history of the Devguide page follows
(with log entries expanded for major content contributions):
Hugo van Kemenade, Sat Dec 30 21:22:04 2023 +0200
Hugo van Kemenade, Fri Dec 8 12:04:32 2023 +0200
Erlend E. Aasland & Hugo van Kemenade, Tue Aug 8 22:05:34 2023 +0200
Satish Mishra, Sat Feb 11 13:54:57 2023 +0530
Hugo van Kemenade, Fri Dec 23 17:33:33 2022 +0200
Skip Montanaro, Hugo, Erlend, & Ezio, Fri Nov 4 05:04:23 2022 -0500
Add a GDB tips section to Advanced Tools (GH-977)
Adam Turner, Wed Jun 15 21:19:23 2022 +0100
Adam Turner, Tue Jun 14 11:12:26 2022 +0100
Suriyaa, Fri Jun 8 19:39:23 2018 +0200
Jeff Allen, Tue Oct 24 18:12:53 2017 +0100
Jeff Allen, Fri Oct 13 13:43:43 2017 +0100
Mariatta, Wed Jan 4 09:14:55 2017 -0800
Carol Willing, Mon Sep 26 14:50:54 2016 -0700
Zachary Ware, Thu Jul 21 10:42:23 2016 -0500
Georg Brandl, Mon Nov 3 11:28:19 2014 +0100
Add instruction how to activate python-gdb.py
Georg Brandl, Sun Mar 9 10:32:01 2014 +0100
Georg Brandl, Tue Apr 3 09:12:53 2012 +0200
Georg Brandl, Sat Mar 5 17:32:35 2011 +0100
Dave Malcolm, Fri Jan 21 12:34:09 2011 -0500
Add documentation on the gdb extension commands provided in libpython.py
I adapted this from documentation I wrote for the Fedora wiki:
https://fedoraproject.org/wiki/Features/EasierPythonDebuggingGH-New_gdb_commands
reformatting it as rst, and making other minor changes
Brett Cannon, Thu Jan 20 15:16:52 2011 -0800
Dave Malcolm, Thu Jan 20 16:17:23 2011 -0500
Add some notes on the gdb pretty-printer hooks
Antoine Pitrou, Thu Jan 20 21:17:49 2011 +0100
Give an example backtrace
Antoine Pitrou, Thu Jan 20 21:03:06 2011 +0100
Expand explanations about gdb support
Brett Cannon, Thu Jan 20 11:33:36 2011 -0800
Tweak the gdb support title to fit in better with the devguide.
Brett Cannon, Mon Jan 17 21:12:54 2011 +0000
Short README on gdb support.
(cherry picked from commit 59057ce55a)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: anatoly techtonik <techtonik@gmail.com>
Co-authored-by: Antoine Pitrou <solipsis@pitrou.net>
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Dave Malcolm <dmalcolm@redhat.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Georg Brandl <georg@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Jeff Allen <ja.py@farowl.co.uk>
Co-authored-by: Mariatta <Mariatta@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Satish Mishra <7506satish@gmail.com>
Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
Co-authored-by: Suriyaa <isc.suriyaa@gmail.com>
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
Keep the page though, because people might still rely on it (the traffic shows that they do).
Instead of our own manual we now give links to the 3rd-party ones.
(cherry picked from commit 705c76d4a2)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Doc/library/xml.rst: Document CVE-2023-52425 under "XML vulnerabilities"
(cherry picked from commit fbd40ce46e)
Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
gh-115653: Document PyCode_GetFirstFree() (GH-115654)
Correct the return type of the PyCode_GetNumFree() documentation.
(cherry picked from commit 10fc4675fd)
Co-authored-by: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>