Commit Graph

25585 Commits

Author SHA1 Message Date
Wenzel Jakob 5e34b494a0
gh-60074: add new stable API function PyType_FromMetaclass (GH-93012)
Added a new stable API function ``PyType_FromMetaclass``, which mirrors
the behavior of ``PyType_FromModuleAndSpec`` except that it takes an
additional metaclass argument. This is, e.g., useful for language
binding tools that need to store additional information in the type
object.
2022-05-27 10:27:39 +02:00
jackh-ncl cc377063ef
gh-91513: Add 'asyncio' taskName to logging LogRecord attributes. (GH-93193) 2022-05-26 09:30:51 +01:00
Victor Stinner 5185956527
gh-69443: Add test.support.Py_DEBUG constant (#93226) 2022-05-26 00:12:54 +02:00
Victor Stinner bf58cd01b3
gh-90817: Deprecate explicitly locale.resetlocale() (#93196)
The function was already deprecated in Python 3.11 since it calls
locale.getdefaultlocale() which was deprecated in Python 3.11.
2022-05-25 22:04:06 +02:00
Victor Stinner 71d8775fee
gh-93202: Always use %zd printf formatter (#93201)
Python now always use the ``%zu`` and ``%zd`` printf formats to
format a size_t or Py_ssize_t number. Building Python 3.12 requires a
C11 compiler, so these printf formats are now always supported.

* PyObject_Print() and _PyObject_Dump() now use the printf %zd format
  to display an object reference count.
* Update PY_FORMAT_SIZE_T comment.
* Remove outdated notes about the %zd format in PyBytes_FromFormat()
  and PyUnicode_FromFormat() documentations.
* configure no longer checks for the %zd format and no longer defines
  PY_FORMAT_SIZE_T macro in pyconfig.h.
* pymacconfig.h no longer undefines PY_FORMAT_SIZE_T: macOS 10.4 is
  no longer supported. Python 3.12 now requires macOS 10.6 (Snow
  Leopard) or newer.
2022-05-25 14:21:36 +02:00
Miro Hrončok 16a7e4a0b7
gh-92728: Restore re.template, but deprecate it (GH-93161)
Revert "bpo-47211: Remove function re.template() and flag re.TEMPLATE (GH-32300)"

This reverts commit b09184bf05.
2022-05-25 09:05:35 +03:00
Victor Stinner c7667a2d35
gh-93103: Enhance PyConfig.parser_debug documentation (#93186)
Document that -d option and PYTHONDEBUG env var require a debug
build of Python. Also mention them in the debug build documentation.
2022-05-24 23:23:01 +02:00
Jordan Borean fbd11f3edd
gh-92658: Add Hyper-V socket support (GH-92755) 2022-05-24 21:37:06 +01:00
Julien Palard e739ff1416
Doc: No need to use rst syntax in code comments. (GH-93102)
And it raises `make suspicious` false positives.
2022-05-23 23:45:16 +02:00
Nicolas Haller 2176898308
gh-92859: Doc: add info about logging.debug() calling basicConfig() (GH-93063) 2022-05-23 20:18:43 +01:00
Steve Dower 6a6f823ea7
gh-92913: Fix typos in documentation (GH-93129) 2022-05-23 17:39:10 +01:00
Victor Stinner fc00667247
gh-93103: Update PyUnicode_DecodeFSDefault() doc (#93105)
Update documentation of PyUnicode_DecodeFSDefault(),
PyUnicode_DecodeFSDefaultAndSize() and PyUnicode_EncodeFSDefault():
they now use the filesystem encoding and error handler of PyConfig,
Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors
variables are no longer used.
2022-05-23 14:56:59 +02:00
Victor Stinner 764e83db85
gh-93103: Deprecate global configuration variable (#93104)
Deprecate global configuration variables, like
Py_IgnoreEnvironmentFlag, in the documentation: the
Py_InitializeFromConfig() API should be instead.
2022-05-23 14:56:35 +02:00
Nicolas Haller 88f0d0c1e8
gh-89158: Add some REPL secondary prompt markers (#93073)
This fixes an issue on tutorial/classes.rst section 9.4 where the example "class Warehouse"
was truncated when pressing the >>> button to hide the prompts and output.
2022-05-23 00:58:07 -04:00
Shantanu e39cd76561
gh-92994: Clarify importlib "check" example (#92995)
Fixes #92994
2022-05-22 18:53:24 -07:00
Stanley b7a6610bc8
gh-73137: Added sub-subsection headers for flags in re (#93000)
Fixes #73137
2022-05-22 18:52:17 -07:00
Jelle Zijlstra ac718d357a
binascii docs: strict_mode parameter is keyword-only (#93055)
See 35b98e38b6

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-05-22 18:48:17 -07:00
Jelle Zijlstra ea5918e932
termios docs: fix indentation (#93080) 2022-05-22 15:55:11 -07:00
Shantanu f9d6c59917
gh-91362: reword pickle docs to account for nested classes (#92429)
Fixes #91362
2022-05-21 07:54:10 -07:00
Serhiy Storchaka 7f835923c1
gh-71223: Improve rendering of some references in the docs (GH-93041)
For example, instead of "eval()uated" (link from "eval()")
show "evaluated" (link from the whole word).
2022-05-21 10:33:23 +03:00
Shantanu 2fadde7e66
gh-93019: Fix markup in zipfile.rst (#93025)
Fixes #93019
2022-05-20 21:36:09 -07:00
Raymond Hettinger 59719a242d
Take advantage of math.comb() in the nth_combination() recipe (#93027) 2022-05-20 18:02:33 -05:00
Brett Cannon d59b2d0441
Fix a directive in the `pathlib` docs (GH-93030) 2022-05-20 15:52:38 -07:00
Stanley f51ed04c66
gh-72073: Add Windows case in pathlib.rename (GH-93002)
#72073

https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.rename
2022-05-20 15:25:39 -07:00
CAM Gerlach 31fa41ed68
gh-92611: Clarify planned removal version in PEP 594-deprecated modules (GH-92793)
As discussed in #92611 and #92564 and as a followup to PR #92612 , this 3.11+ only PR uses the proper `deprecated-removed` role for the modules deprecated by PEP 593 (PEP-594) to clearly indicate to users that a removal version is planned and what it is, so they can prepare accordingly or voice any unanticipated impacts.

Related to #92792 ; if we decide to backport that PR, the upgrade to using `deprecated-removed` on those functions can be moved to this one.
2022-05-20 14:47:51 -07:00
Shantanu f20a6a54fb
gh-91860: documentation for typing.dataclass_transform (#92768)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-20 07:32:29 -07:00
Rafael Fontenelle 0e12781ad9
Doc: add missing manpage and title references in tkinter docs (#29008)
- add bind(3tk) manpage markup
- add Tcl/Tk book reference markup
2022-05-20 10:19:37 +02:00
Pavel a637c09a60
Doc: Minor adjustment of `socket.create_server` docs (#26938)
- fix spelling in create_server() docs
- add a line about create_server() in the socket.py docstring
2022-05-20 10:18:02 +02:00
Steve Dower 403d16fa28
gh-92913: Clarify changes to PyInitConfig.module_search_paths[_set] fields (GH-92980) 2022-05-19 20:23:53 +01:00
Mark Shannon 3fd8610002
GH-89914: Make the oparg of the YIELD_VALUE instruction equal the stack depth. (GH-92960) 2022-05-19 17:49:29 +01:00
Alex Waygood 70aa1b9b91
gh-92417: `importlib` docs: remove references to unsupported Python versions (GH-92424)
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-05-19 17:48:44 +02:00
Martin Fischer 2cdd57f119
bpo-46879: Fix incorrect sphinx object names in doc (GH-31615)
API members documented in sphinx have an object name, which allow the
documentation to be linked from other projects. Sphinx calculates the
object name by prefixing the current module name to the directive
argument, e.g:

.. module:: foo
.. function:: bar.baz

becomes foo.bar.baz. Since these anchors aren't displayed in the
documentation, some mistakes have crept in, namely the Python stdlib
documentation currently contains the objects:

* asyncio.asyncio.subprocess.DEVNULL
* asyncio.asyncio.subprocess.PIPE
* asyncio.asyncio.subprocess.STDOUT
* asyncio.asyncio.subprocess.Process
* multiprocessing.sharedctypes.multiprocessing.Manager
* xml.etree.ElementTree.xml.etree.ElementInclude

This commit fixes this by making use of the :module: option which
without an argument makes sphinx take the directive argument as is
for the object name (avoiding the prefixing of the current module
name that led to these broken object names).

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-05-19 17:34:58 +02:00
Alex Waygood 84b86000e2
gh-92417: `subprocess` docs: remove note on compatibility with Python <3.5 (GH-92538) 2022-05-19 17:31:51 +02:00
Alex Waygood 090df844ea
gh-92417: `fractions`, `decimal`: Improve docs for alternative constructor methods (GH-92421)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2022-05-19 17:28:51 +02:00
Alex Waygood 639b62c9c4
gh-92417: `socket` docs: remove references to Python <3.3 (GH-92544) 2022-05-19 17:25:58 +02:00
Zackery Spytz fb082c2fc5
bpo-45393: help() on operator precedence has misleading entries (GH-31246)
Fix the formatting for "await x" and "not x" in the operator
precedence table.
2022-05-19 17:05:04 +02:00
CAM Gerlach 97b9c1096f
gh-92417: Update docs and examples of doctest.IGNORE_EXCEPTION_DETAIL for Py>=3 (GH-92502) 2022-05-19 16:59:07 +02:00
Jelle Zijlstra 6b51773afd
gh-91491: Complete Whats New in 3.11 for typing (#92708)
Fixes #91491

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-19 07:07:54 -07:00
Mark Shannon e48ac9c100
GH-90690: Remove `PRECALL` instruction (GH-92925) 2022-05-19 11:05:26 +01:00
Jan Brasna 41638967a0
Doc: amend ssl.PROTOCOL_SSLv2 and ssl.PROTOCOL_SSLv3 wording (#92634) 2022-05-19 11:22:16 +02:00
Duprat 60ee61571a
Include ``asyncio.Barrier`` in 3.11 Whats New (GH-92927) 2022-05-19 15:12:33 +08:00
Inada Naoki 96f65835f8
gh-87901: Remove the encoding argument from os.popen (GH-92836) 2022-05-19 11:42:43 +09:00
180909 f2d994da10
gh-92812: Align ArgumentParser.add_subparsers() docs with argument spec (#92814) 2022-05-18 23:08:23 +02:00
David CARLIER 9a1adf2790
bpo-42047: Add native thread ID for DragonFlyBSD (#22714)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: kj <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-18 15:10:10 +02:00
Victor Stinner e0477ae371
gh-91755: Remove doc of C API private refcount functions (#92918)
These functions should only be used by Python internals.
2022-05-18 14:09:44 +02:00
Erlend Egeberg Aasland 7ee19e2715
gh-92780: Improve sqlite3.Connection.create_collation docs (#92790)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-18 13:44:16 +02:00
Charlie Zhao 58a3d28039
gh-91755: Document Py_IncRef and Py_DecRef as C functions (#91805)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-18 10:42:05 +02:00
Nikita Sobolev b86d783a4e
bpo-40838: document `getdoc`, `getmodule`, `getsourcefile` in `inspect` returns `None` (#30575)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-17 18:24:35 -07:00
谭九鼎 bd30461298
re docs: fix source code link (#92819) 2022-05-16 17:04:17 -07:00
Erlend Egeberg Aasland 00f22e8cc2
gh-92547: Remove deprecated sqlite3 features (#92548)
The following sqlite3 features were deprecated in 3.10, scheduled for
removal in 3.12:

- sqlite3.OptimizedUnicode (gh-23163)
- sqlite3.enable_shared_cache (gh-24008)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Signed-off-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-05-16 19:52:08 +02:00
Hugo van Kemenade a487623c6b
Speedup: build docs in parallel (GH-92733) 2022-05-16 13:52:00 +02:00
Pablo Galindo Salgado 0d8500c739
gh-81548: Clarify the deprecation of octal sequences affect byte strings (GH-92643)
Automerge-Triggered-By: GH:pablogsal
2022-05-16 03:42:58 -07:00
Stanley 3ed1cae9ed
gh-87670: Add web.archive redirects from effbot (GH-92816) 2022-05-16 08:11:43 +02:00
Ezio Melotti 953ab07952
Restore default role check in `make check`. (#92290)
* Restore default role check in `make check`.

* Options first, then files.

* Update `make.bat` too.

* Add a comment explaining the extra options.

* No reason to ignore the README.rst.

* Enable default-role check in sphinx-lint.

Co-authored-by: Julien Palard <julien@palard.fr>

* Update sphinx-lint default-role check.

* Fix use of the default role in the docs.

* Update make.bat to check for the default role too.

* Fix comment in make.bat.

Co-authored-by: Julien Palard <julien@palard.fr>
2022-05-15 17:34:52 +02:00
CAM Gerlach 9f68dab3d3
gh-92611: Link to PEP 594 sections & add key detail in doc deprecation notices (GH-92612) 2022-05-13 12:54:12 -07:00
yashlad681 3115c2c036
gh-91249: Remove .bat extension in documentation for when activating venv on Windows. (GH-92770) 2022-05-13 15:36:05 +01:00
slateny 3e3e8976b8
bpo-9182: Add a section on specifying positional arguments (#31810) 2022-05-13 09:17:07 -05:00
Gabi Nagy 57da3ff586
Fix small typo (#92721) 2022-05-13 09:15:20 -05:00
180909 b39f841047
gh-92446: Argparse choices should be a sequence (#92450) 2022-05-13 09:06:08 -05:00
Julien Palard 664aa94b57
Document Py_ssize_t. (GH-92512)
It fixes 252 errors from a Sphinx nitpicky run (sphinx-build -n). But
there's 8182 errors left.

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2022-05-13 14:10:16 +02:00
Victor Stinner 059b5baf98
gh-85858: Remove PyUnicode_InternImmortal() function (#92579)
Remove the PyUnicode_InternImmortal() function and the
SSTATE_INTERNED_IMMORTAL macro.

The PyUnicode_InternImmortal() function is still exported in the
stable ABI. The function is removed from the API.

PyASCIIObject.state.interned size is now a single bit, rather than 2
bits.

Keep SSTATE_NOT_INTERNED and SSTATE_INTERNED_MORTAL macros for
backward compatibility, but no longer use them internally since the
interned member is now a single bit and so can only have two values
(interned or not interned).

Update stats of _PyUnicode_ClearInterned().
2022-05-13 13:40:22 +02:00
Inada Naoki e371d5d5d1
gh-92536: Doc update about Py_UNICODE removal (GH-92756) 2022-05-13 13:15:41 +09:00
Jelle Zijlstra 8a0d9a6bb7
gh-92514: Remove unused test.support.BasicTestRunner (#92515) 2022-05-12 07:24:04 -07:00
Jelle Zijlstra 6582c96454
gh-92436: __future__ docs: add note on expectations for "from __future__ import annotations" (#92568) 2022-05-12 07:23:42 -07:00
Inada Naoki f9c9354a7a
gh-92536: PEP 623: Remove wstr and legacy APIs from Unicode (GH-92537) 2022-05-12 14:48:38 +09:00
Raymond Hettinger 68fec31364
gh-86388 Remove deprecated behaviors in randrange() (#92677) 2022-05-11 23:54:51 -05:00
thueringa f67d71b431
Fix typo in argparse docs. (GH-92691)
# Fix typo in argparse docs.

> Sometimes, when dealing with **a** particularly long argument list**s**, [...]

Mixture between plural and singular forms is incorrect. Use singular consistently since typically only a single argument list is employed. Change to:

> Sometimes, when dealing with a particularly long argument list, [...]

No issue was opened, since this is a trivial change.

Automerge-Triggered-By: GH:rhettinger
2022-05-11 20:25:09 -07:00
Victor Stinner 1a9645f537
gh-89653: PEP 670: Fix Sphinx syntax in Unicode doc (#92707) 2022-05-12 03:38:49 +02:00
Victor Stinner d0c9353a79
gh-89653: PEP 670: unicodeobject.h uses _Py_CAST() (#92696)
Use _Py_CAST() and _Py_STATIC_CAST() in macros wrapping static inline
functions of unicodeobject.h.

Change also the kind type from unsigned int to int: same parameter
type than PyUnicode_FromKindAndData().

The limited API version 3.11 no longer casts arguments to expected
types.
2022-05-12 01:35:41 +02:00
Victor Stinner 92f0ed1d90
gh-89653: PEP 670: Update C API unicode documentation (#92702) 2022-05-12 01:33:52 +02:00
Steve Dower b3f99b69d0
Fix minor documentation error in bisect docs (GH-92697) 2022-05-11 23:56:58 +01:00
Victor Stinner da5727a120
gh-92651: Remove the Include/token.h header file (#92652)
Remove the token.h header file. There was never any public tokenizer
C API. The token.h header file was only designed to be used by Python
internals.

Move Include/token.h to Include/internal/pycore_token.h. Including
this header file now requires that the Py_BUILD_CORE macro is
defined. It no longer checks for the Py_LIMITED_API macro.

Rename functions:

* PyToken_OneChar() => _PyToken_OneChar()
* PyToken_TwoChars() => _PyToken_TwoChars()
* PyToken_ThreeChars() => _PyToken_ThreeChars()
2022-05-11 23:22:50 +02:00
Hugo van Kemenade 75e463430e
gh-89336: Fix configparser.RawConfigParser.readfp typo (GH-92636) 2022-05-11 09:18:45 +03:00
Mikhail Terekhov 38486ca212
Fix typo in unittest.rst: addCleanupModule -> addModuleCleanup (GH-92631) 2022-05-11 09:14:12 +03:00
Serhiy Storchaka b1c4368824
Revert "gh-92550 - Fix regression in `pathlib.Path.rglob()` (GH-92583)" (GH-92598)
This reverts commit dcdf250d2d.
2022-05-11 07:14:25 +03:00
Victor Stinner 303e5d57bc
What's New 3.12: PyFrame_BlockSetup() was removed in 3.11 (#92645)
What's New in Python 3.11: "PyFrame_BlockSetup() and
PyFrame_BlockPop() have been removed.  (Contributed by Mark Shannon
in bpo-40222.)"
https://docs.python.org/dev/whatsnew/3.11.html#id8
2022-05-11 01:28:17 +02:00
Raymond Hettinger 63794dbc93
gh-91966 Document where key functions are applied in the bisect module (#92602) 2022-05-10 17:18:58 -05:00
Jürgen Gmach fe1c5ba608
bpo-43689: improve documentation for Differ (GH-25132)
Lines beginning with ``?`` try to help understanding the given diff.

The output can be hard to understand when it contains whitespace characters, such as spaces, tabs or line breaks.

While previously only tabs were mentioned, now all are listed.

Automerge-Triggered-By: GH:rhettinger
2022-05-10 13:57:12 -07:00
Gregory P. Smith 07b34926d3
gh-84131: Remove the deprecated pathlib.Path.link_to method. (#92505)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
2022-05-10 12:31:41 -07:00
Géry Ogam dde8a1668e
Update numbers.rst (#31995) 2022-05-10 13:01:49 -05:00
andrei kulakov 392fd272cd
bpo-42259: clarify pprint saferepr docs (#30256) 2022-05-10 12:22:36 -05:00
slateny 549567c6e7
gh-80143: Add clarification for escape characters (#92292) 2022-05-10 11:12:29 -05:00
CAM Gerlach f1bbcba74f
gh-76773: Update docs mentioning no-longer-supported Windows versions & features (GH-92529) 2022-05-10 09:30:32 +03:00
Alex Waygood 7c638e6405
gh-92417: `zlib` docs, `binascii` docs: remove Python 2 compatibility notes (GH-92543) 2022-05-10 08:48:18 +03:00
Alex Waygood 6823ba4a9e
gh-92417: `unittest.mock` docs: remove references to Python <2.6 (GH-92539) 2022-05-10 08:47:36 +03:00
Paul Ganssle a0a825c38a
gh-91928: Add what's new entry for datetime.UTC alias (GH-92567)
I merged this without a What's New entry to avoid merge conflicts, so here's the follow-up adding the entry.

@Kab1r do you mind reviewing?

Closes #91928

Automerge-Triggered-By: GH:pganssle
2022-05-09 20:51:28 -07:00
Cheryl Sabella c56e2bb994
bpo-13553: Document tkinter.Tk args (#4786) 2022-05-09 20:49:00 -07:00
Barney Gale dcdf250d2d
gh-92550 - Fix regression in `pathlib.Path.rglob()` (GH-92583)
We could try to remedy this by taking a slice, but we then run into an issue where the empty string will match altsep on POSIX. That rabbit hole could keep getting deeper.

A proper fix for the original issue involves making pathlib's path normalisation more configurable - in this case we want to retain trailing slashes, but in other we might want to preserve `./` prefixes, or elide `../` segments when we're sure we won't encounter symlinks.

This reverts commit ea2f5bcda1.
2022-05-09 17:12:16 -07:00
Gregory P. Smith 6ed7c353b8
gh-88750: Remove the PYTHONTHREADDEBUG env var support. (#92509)
Remove the `PYTHONTHREADDEBUG` env var support.
Remove no-op dprintf() macro calls.
2022-05-09 16:03:46 -07:00
Julien Palard b77a95f44a
Doc: Update py2app link. (#91585)
See: https://mail.python.org/archives/list/docs@python.org/thread/KDVFGNGGUGGPVRZT7WZYHHWXCRS2GEN7/
2022-05-09 23:10:19 +02:00
slateny e3fa60b937
gh-86019: Add table for Windows installer options (GH-91809) 2022-05-09 17:40:51 +01:00
Ken Jin be3cdd66c9
gh-91345: Talk about ``sys._getframe`` compatibility in 3.11 whatsnew (GH-92552) 2022-05-09 14:45:13 +01:00
Victor Stinner 11a608d2b1
What's New in Python 3.12: move C API at the end (#92555)
* Separate Build and C API changes in two sections
* Add sub-sections to the C API changes
2022-05-09 14:26:30 +02:00
Victor Stinner d8104d13cd
What's New in Python 3.11: move C API changes (#92390)
Move C API changes to the C API > Porting to Python 3.11 section.
2022-05-09 12:40:56 +02:00
Victor Stinner 7b9803f93f
Enhance PyConfig documentation (#92394) 2022-05-09 12:35:59 +02:00
Ma Lin 5bc2390229
bpo-38056: overhaul Error Handlers section in codecs documentation (#15732)
* Some handlers were wrongly described as text-encoding only, but actually they can also be used in text-decoding.
* Add more description to each handler.
* Add two REPL examples.
* Add indexes for Error Handler's name.

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-08 19:58:55 -07:00
Rafael Fontenelle f298ba1f27
bpo-39229: fix formatting in library/functions.rst (#17857)
Missing reference of auditing event presents error when building translated documentation
2022-05-08 16:21:19 -07:00
Godefroid Chapelle 2888b1107f
pdb docs: workaround for double semicolon in strings (#17011)
see https://github.com/gotcha/ipdb/issues/172

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-08 16:20:42 -07:00
David CARLIER 9d85aba9e2
gh-91968: Add socket constants SO_USER_COOKIE/SO_RTABLE from BSD (#91967)
Those are somewhat equivalent to Linux' SO_MARK.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-08 16:19:41 -07:00
slateny 859250cc55
gh-77521: Add link to builtin module names in modules tutorial (#92438)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-08 12:30:38 -07:00
Ken Jin 9304f98558
Use percentage over factor for 3.11 whatsnew performance (GH-92496) 2022-05-09 00:44:55 +08:00
Serhiy Storchaka a84a56d80f
gh-91760: More strict rules for numerical group references and group names in RE (GH-91792)
Only sequence of ASCII digits is now accepted as a numerical reference.
The group name in bytes patterns and replacement strings can now only
contain ASCII letters and digits and underscore.
2022-05-08 19:19:29 +03:00
Davide Rizzo 7b024e3a3f
gh-80856: doc: reveal doctest directives (#92318)
* Doc: Reveal doctest directives.

* Fix whitespace.

Co-authored-by: Julien Palard <julien@palard.fr>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2022-05-08 18:14:55 +02:00
Ezio Melotti 5c3ecddad7
Fix typo in whatsnew (GH-92488)
Automerge-Triggered-By: GH:ezio-melotti
2022-05-08 09:02:27 -07:00
Oleg Iarygin 063e8ab72b
Fix the `versionadded` for asyncio.StreamWriter.start_tls() (#92378) 2022-05-08 08:44:54 -07:00
Alex Waygood 318c4e91ef
gh-92417: `logging` docs: Remove warning that only applies to Python <3.2 (#92425) 2022-05-08 08:36:38 -07:00
Serhiy Storchaka 9c005c5deb
Fix What's New for 3.12 (GH-92482) 2022-05-08 18:23:08 +03:00
Alex Waygood bdc99a830f
`typing.Text`: tweak deprecation notice (#92405)
https://github.com/python/cpython/pull/92351/files#r866869469

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-08 08:22:32 -07:00
Ken Jin b7380948f2
Update What's New in 3.11 faster cpython figures and contributors (GH-92401) 2022-05-08 23:05:30 +08:00
Serhiy Storchaka 086c6b1b0f
bpo-45046: Support context managers in unittest (GH-28045)
Add methods enterContext() and enterClassContext() in TestCase.
Add method enterAsyncContext() in IsolatedAsyncioTestCase.
Add function enterModuleContext().
2022-05-08 17:49:09 +03:00
slateny 8f29318079
gh-77630: Change Charset to charset (GH-92439) 2022-05-08 17:35:32 +03:00
Alex Waygood 8efda1e7c6
gh-92417: `stdtypes` docs: delete discussion of Python 2 differences (GH-92423)
Given that 2.7 has now been end-of-life for two and a half years,
I don't think we need such a detailed explanation here anymore of
the differences between Python 2 and Python 3.
2022-05-08 16:23:22 +03:00
Hugo van Kemenade 788ef54bc9
GH-92431: Fix footnotes in Doc/c-api/exceptions.rst (GH-92432)
* Remove redundant footnote ref: the footnote has been removed
* Fix footnote ref to match footnote
* Convert footnotes into reST footnotes: will error if missing
2022-05-08 16:19:16 +03:00
Alex Waygood 5639ea1ef9
gh-92417: `doctest` docs: remove references to Python <3.6 (GH-92420) 2022-05-08 16:17:23 +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
Alex Waygood f4e317b304
gh-92417: `asyncio` docs: `asyncio.run()` is available on all supported Python versions (GH-92419) 2022-05-08 16:16:19 +03:00
Alex Waygood e5b4bd4d60
gh-92417: `typing` docs: `from __future__ import annotations` can be used in all supported Python versions (GH-92418) 2022-05-08 16:15:38 +03:00
Dong-hee Na 45e1721d10
gh-92448: Update the documentation builder to render the GitHub issue. (GH-92449) 2022-05-08 21:50:40 +09:00
Pablo Galindo 09f0ad48ef
Update the SOURCE_URI in pyspecific.py to point to the new branch 2022-05-08 03:48:31 +01:00
Pablo Galindo 75de8e69b4
Merge remote-tracking branch 'upstream/main' 2022-05-08 03:43:47 +01:00
Pablo Galindo e851177536
Python 3.12.0a0 2022-05-08 03:40:52 +01:00
Erlend Egeberg Aasland 0924b95f6e
gh-92308: Add Pending Removal section to 3.11 What's New (#92309)
* gh-92308: Add Pending Removal section to 3.11 What's New

* Use compact list; drop attributions

* Add short text, and also missing PyUnicode_InternImmortal

* Fix formatting

* markup fix

* Update Doc/whatsnew/3.11.rst

Co-authored-by: Victor Stinner <vstinner@python.org>

* Apply suggestions from code review

Co-authored-by: Victor Stinner <vstinner@python.org>

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2022-05-07 06:23:13 +02:00
Pablo Galindo 8d32a5c8c4
Update the SOURCE_URI in pyspecific.py to point to the new branch 2022-05-06 23:56:26 +01:00
larryhastings 5021064390
gh-92203: Add closure support to exec(). (#92204)
Add a closure keyword-only parameter to exec(). It can only be specified when exec-ing a code object that uses free variables. When specified, it must be a tuple, with exactly the number of cell variables referenced by the code object. closure has a default value of None, and it must be None if the code object doesn't refer to any free variables.
2022-05-06 10:09:35 -07:00
gophra a79001ee16
gh-92368: Fix missing possessive apostrophe (#92397)
* Fix missing possessive apostrophe
2022-05-06 15:39:16 +02:00
Serhiy Storchaka 5fbaf80057
Fix What's New: use :gh: instead of :issue: (#92395) 2022-05-06 13:32:10 +01:00
Serhiy Storchaka 15dbe8570f
gh-91827: Add method info_pathlevel() in tkinter (GH-91829) 2022-05-06 13:50:38 +03:00
Alex Waygood 6f18b86fda
gh-92332: Docs-only deprecation of `typing.Text` (GH-92351)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-05-06 18:15:18 +08:00
Alex Waygood 291945bc6e
Enum docs: Remove unnecessary apostrophes (#92382)
Replace "it's" with "its".
2022-05-06 11:53:00 +02:00
Matt Wozniski 740da8d37a
Document the lifetime of `PyUnicode_AsUTF8String` (#92325)
The current wording implied this, but didn't state it explicitly.
2022-05-06 10:37:08 +01:00
Raymond Hettinger ebaf0945f9
GH-89519: Deprecate classmethod descriptor chaining (#92379) 2022-05-06 02:57:53 -05:00
Ethan Furman 93364f9716
gh-78157: [Enum] nested classes will not be members in 3.13 (GH-92366)
- add member() and nonmember() functions
- add deprecation warning for internal classes in enums not
  becoming members in 3.13

Co-authored-by: edwardcwang
2022-05-06 00:16:22 -07:00
Gregory P. Smith fa4f0a134e
gh-90622: Prevent max_tasks_per_child use with a fork mp_context. (#91587)
Prevent `max_tasks_per_child` use with a "fork" mp_context to avoid deadlocks.

Also defaults to "spawn" when no mp_context is supplied for safe convenience.
2022-05-06 00:04:53 -07:00
Inada Naoki 2b563f1ad3
gh-87901: Add encoding to os.popen (GH-92374) 2022-05-06 14:48:36 +09:00
Hai Shi 301351c6a2
update argparse's doc of append action. (#92344) 2022-05-05 22:32:35 -05:00
Victor Stinner 299692afd8
gh-88279: Deprecate PySys_SetArgvEx() (#92363)
Deprecate the following C functions:

* PySys_SetArgv()
* PySys_SetArgvEx()
* PySys_SetPath()
2022-05-06 05:24:29 +02:00
Victor Stinner 5f29268283
gh-57684: Document safe path in What's New in Python 3.11 (#92362)
Mention also -P and PYTHONSAFEPATH in the Security Considerations
page.
2022-05-06 04:53:00 +02:00
Paul Ganssle 1303f8c927
gh-80010: Expand fromisoformat to include most of ISO-8601 (#92177)
This expands `fromisoformat` to cover most of the common uses of ISO 8601. We may expand the scope more in the future.
2022-05-05 18:31:24 -06:00
Victor Stinner ada8b6d1b1
gh-57684: Add -P cmdline option and PYTHONSAFEPATH env var (#31542)
Add the -P command line option and the PYTHONSAFEPATH environment
variable to not prepend a potentially unsafe path to sys.path.

* Add sys.flags.safe_path flag.
* Add PyConfig.safe_path member.
* Programs/_bootstrap_python.c uses config.safe_path=0.
* Update subprocess._optim_args_from_interpreter_flags() to handle
  the -P command line option.
* Modules/getpath.py sets safe_path to 1 if a "._pth" file is
  present.
2022-05-06 01:34:11 +02:00
Gregory P. Smith f6dd14c653
gh-82616: Add process_group support to subprocess.Popen (#23930)
One more thing that can help prevent people from using `preexec_fn`.

Also adds conditional skips to two tests exposing ASAN flakiness on the Ubuntu 20.04 Address Sanitizer Github CI system. When that build is run on more modern systems the "problem" does not show up. It seems ASAN implementation related.

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-05-05 16:22:32 -07:00
cibofo 9a0a7b4868
gh-91996: Add an HTTPMethod StrEnum to http (GH-91997)
* Add HTTPMethod enum to http

Create a StrEnum for the 9 common HTTP methods.

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2022-05-05 15:39:02 -07:00
Gregory P. Smith 354ab7a5c8
minor hashlib doc example cleanup. (#92340)
Closes #85465
2022-05-05 09:48:17 -07:00
Soumendra Ganguly ae553b3561
bpo-41818: Add os.login_tty() for *nix. (#29658)
* Add `os.login_tty(fd)` for Unix.

Reviewed-by: Christian Heimes <christian@python.org>
Signed-off-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2022-05-05 09:04:44 -07:00
Robert Howlett 43b135f94e
gh-92047: Py_GetVersion multi-digit minor version (GH-92047) (#92048) 2022-05-05 11:33:35 +02:00
Sebastian Rittau d1b2e989be
gh-92223: Remove pre-Python 3.7 alternative in asyncio docs (#92224) 2022-05-04 17:14:07 -07:00
Carl Meyer 7d7a378c1a
Fix typo in Sorting howto (#92280)
The phrase is usually "odds and ends," not "odd and ends."
2022-05-03 21:38:29 -06:00
Kabir Kwatra 48c6165c28
gh-91928: Add `datetime.UTC` alias for `datetime.timezone.utc` (GH-91973)
### fixes #91928

`UTC` is now module attribute aliased to `datetime.timezone.utc`.
You can now do the following:
```python
from datetime import UTC
```
2022-05-03 15:14:25 -07:00
Robert Yang ee2205b208
gh-87304: Improve comments in language reference for imports (#92164) 2022-05-03 16:08:05 -06:00
Jelle Zijlstra 27e3665715
Improve the typing docs (#92264)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-03 15:49:21 -06:00
Victor Stinner 2eca5dad0a
gh-89653: PEP 670: Convert PyBytes macros to functions (#91990)
Convert the following macros to static inline functions:

* PyByteArray_AS_STRING()
* PyByteArray_GET_SIZE()
* PyBytes_AS_STRING()
* PyBytes_GET_SIZE()

Limited C API version 3.11 no longer casts arguments.

Add _PyBytes_CAST() and _PyByteArray_CAST() macros.
2022-05-03 20:14:58 +02:00
David CARLIER d5dfcd4489
bpo-46696: Add socket.SO_INCOMING_CPU constant (#31237)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-03 11:33:11 -06:00
slateny 9dc4aae8e9
Link to GitHub instead of BPO for CPython bug tracker (GH-92221) 2022-05-03 22:40:36 +08:00
Samodya Abey f6f36cc269
bpo-44863: Allow generic typing.TypedDict (#27663)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-05-03 07:21:42 -06:00
Ken Jin 6c7249f265
gh-92154: Expose PyCode_GetCode in the C API (GH-92168) 2022-05-03 21:13:13 +08:00
Carey Metcalfe 78e70be331
gh-70363: Implement `io.IOBase` interface for `SpooledTemporaryFile` (GH-29560)
Since the underlying file-like objects (either `io.BytesIO`,
or a true file object) all implement the `io.IOBase`
interface, the `SpooledTemporaryFile` should as well.

Additionally, since the underlying file object will either be an
instance of an `io.BufferedIOBase` (for binary mode) or an
`io.TextIOBase` (for text mode), methods for these classes were also
implemented.

In every case, the required methods and properties are simply delegated
to the underlying file object.

Co-authored-by: Gary Fernie <Gary.Fernie@skyscanner.net>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2022-05-03 21:18:18 +09:00
Ken Jin c1767fce52
Fix doc warnings in What's New in 3.11 (GH-92215) 2022-05-03 14:49:06 +08:00
Serhiy Storchaka b04e02c57f
bpo-43923: Add support for generic typing.NamedTuple (#92027) 2022-05-02 16:41:23 -06:00
Meer Suri cc6ae4f483
bpo-46586: Fix more erroneous doc links to builtins (#31429)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Éric <merwok@netwok.org>
2022-05-02 16:32:44 -06:00
Géry Ogam 2d30adee72
bpo-46285: Add command-line option -p/--protocol to module http.server (#30999)
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-02 16:28:45 -06:00
Yassir Karroum 32e4f450af
bpo-6686: Replace String with Bytes in xml.sax.handler documentation (#30612) 2022-05-02 16:26:42 -06:00
David Gilbertson 5f45a9d3c3
importlib docs: Update importlib.abc hierarchy (#31113)
Fixed some inconsistencies in the text about relationships
2022-05-02 14:26:35 -06:00
Benjamin Peterson dd57fe1dd7
Fix duplicate word. (GH-92182) 2022-05-02 13:43:52 -06:00
Jelle Zijlstra ff88f7e007
gh-87390: Add __unpacked__ attribute to types.GenericAlias (#92059) 2022-05-02 13:21:59 -06:00
Sam Ezeh 4b297a9ffd
gh-91783: Document security considerations for shutil.unpack_archive (#91844) 2022-05-02 11:15:04 -06:00
Eric V. Smith 5f9c0f5ddf
Add weakref_slot to dataclass decorator, to allow instances with slots to be weakref-able. (#92160) 2022-05-02 10:36:39 -06:00
Thaddeus1499 958f21c5cd
gh-92082: contextlib docs: Change aclosing from a class to a function for consistency (#92155)
Signed-off-by: prwatson <prwatson@redhat.com>
2022-05-02 10:20:30 -06:00
slateny b9ab6cea08
gh-88546: glob.glob docs: Make new paragraph for emphasis and reordered sentence (#91614) 2022-05-02 09:11:05 -06:00
Harsh bb857a96ef
asyncio.subprocess: Fix a typo in doc (#92030)
Remove a confusion for read method in asyncio-subprocess doc for stderr StreamReader instance
2022-05-02 09:01:52 -06:00
Matt Harding 2a7efa3242
Fix typo in Programming FAQ (#92083)
I believe the word "with" was missing here.
2022-05-02 09:01:03 -06:00
slateny b25352a5c0
gh-85133: os docs: Add that getenv uses os.environ (#91874)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-02 08:43:32 -06:00
slateny 9166ace805
gh-84714: Add behavior if dst file exists (#91867) 2022-05-02 08:31:55 -06:00
Victor Stinner 6811bdef63
gh-88097: doc: fix link to Py_Version (#92141) 2022-05-02 15:29:22 +02:00
Inada Naoki 614420df97
gh-85679: Recommend `encoding="utf-8"` in tutorial (GH-91778) 2022-05-02 17:25:05 +09:00
vainaijr ed711290a0
gh-91998: 'WebAssemby' to 'WebAssembly' (#92040) 2022-05-01 20:24:41 -05:00
Sam Bull 9588f880a2
typing docs: Add example for async functions (#20386)
Fixes python/typing#424
2022-04-30 22:40:27 -06:00
slateny 1066ecb970
gh-81488: Add recursive wording for issubclass docs (#92087) 2022-04-30 22:05:20 -06:00
Inada Naoki 0729b31a8b
gh-91952: Make TextIOWrapper.reconfigure() supports "locale" encoding (GH-91982) 2022-05-01 10:44:14 +09:00
Antonio Andrade 238aa6253b
Improving readability of argparse.rst (GH-91751)
Fixed few typos and enhanced few paragraphs for your review and consideration.
Trivial contribution towards continuous improvement, so no issue was raised.

Automerge-Triggered-By: GH:rhettinger
2022-04-30 15:20:10 -07:00
slateny 5dcfb916c7
gh-89253: Add 3.10 whatsnew section for itertools.pairwise (GH-91563)
#89253

[`pairwise()`](https://docs.python.org/3/library/itertools.html#itertools.pairwise) already has the 'new in python3.10'

Automerge-Triggered-By: GH:rhettinger
2022-04-30 15:14:38 -07:00
slateny efb87b1090
gh-85757: Change wording from nested to inner (GH-91811)
#85757

https://docs.python.org/3/tutorial/datastructures.html#nested-list-comprehensions

I do think this is clearer, but I wonder if 'nested' should be kept though to get the terminology out there more often. So perhaps it could be something like 'inner (nested) listcomp' or 'nested (inner) listcomp' despite sounding a bit redundant

Automerge-Triggered-By: GH:rhettinger
2022-04-30 15:12:33 -07:00
Yurii Karabas 2b97d7f6df
Fix typo in asyncio-extending.rst (#91609) 2022-04-30 16:09:48 -06:00
Motoki Naruse ea39246782
gh-91611: Use example.com for documentation, not mydomain.com (#91613)
example.com is reserved by the IANA as special-use domain name for documentation
purposes. The domain names are used widely in books, tutorials, sample network
configurations, and generally as examples for the use of domain name.

On the other hand, mydomain.com is real Domain Name Registration service.
2022-04-30 15:52:13 -06:00
slateny 567be058b4
gh-87801: Add run() to subprocess.CalledProcessError description (#91628) 2022-04-30 15:32:00 -06:00
slateny d7eb1ffbe8
gh-87192: Update wording for fcntl 'Changed in' (#91658) 2022-04-30 15:24:01 -06:00
Dennis Sweeney b660d0931e
Convert :issue: to :gh: in whatsnew (GH-92089) 2022-04-30 15:53:59 -04:00
slateny 3a8e2b6e65
gh-85864: io docs: Add missing position-only parameters (#91950) 2022-04-30 09:22:33 -06:00
Erlend Egeberg Aasland 9ea9078ec7
gh-92019: Make sqlite3.Blob indexing conform with the norm (#92020)
- get index now returns an int
- set index now requires an int in range(0, 256)

Resolves #92019
2022-04-30 09:01:37 -06:00
Serhiy Storchaka 3483299a24
gh-81548: Deprecate octal escape sequences with value larger than 0o377 (GH-91668) 2022-04-30 13:16:27 +03:00
Serhiy Storchaka 19dca04121
gh-91760: Deprecate group names and numbers which will be invalid in future (GH-91794)
Only sequence of ASCII digits will be accepted as a numerical reference.
The group name in bytes patterns and replacement strings could only
contain ASCII letters and digits and underscore.
2022-04-30 13:13:46 +03:00
Inada Naoki 354ace8b07
gh-91954: Emit EncodingWarning from locale and subprocess (GH-91977)
locale.getpreferredencoding() and subprocess.Popen() emit EncodingWarning
2022-04-30 15:53:29 +09:00
Shantanu 2f7952c35b
Rephrase typing.assert_never docs (#92061)
This change is similar to that in #32069
2022-04-29 21:13:21 -06:00
Shantanu d0064a1e72
gh-91491: Add several typing features to What's New (#92060)
This gets all the major items in #91491. However, I didn't get around to
adding what's new entries for the large clump of changes in the last
bullet point in the issue.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-29 21:12:45 -06:00
Brett Cannon c2b579741d
gh-91217: deprecate xdrlib (GH-92066)
Automerge-Triggered-By: GH:brettcannon
2022-04-29 18:22:10 -07:00
Jelle Zijlstra 7861a9e327
Fix indentation for typing.Unpack docs (#92058)
https://docs.python.org/3.11/library/typing.html#typing.Unpack
2022-04-29 16:58:40 -06:00
slateny 53ca774497
sorting howto: Add clarification on < using __lt__ (#92010) 2022-04-29 16:08:07 -06:00
Serhiy Storchaka 81120b6754
bpo-44791: Accept ellipsis as the last argument of typing.Concatenate (#30969) 2022-04-29 15:01:40 -06:00
Hugo van Kemenade 89c6b2b8f6
bpo-36329: Remove 'make -C Doc serve' in favour of 'make -C Doc htmlview' (GH-32354)
Also updated `make -C htmlview` so it used a full path with `file://`, because the original didn't open the page (macOS).

For example:
```sh
cd Doc

# Doesn't open anything:
python3 -c "import webbrowser; webbrowser.open('build/html/index.html')"

# Opens the docs page e.g. file:///Users/hugo/github/cpython/Doc/build/html/index.html :
python3 -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('build/html/index.html'))"
```

https://bugs.python.org/issue36329
2022-04-29 15:47:26 +02:00
Ken Jin 64113a4ba8
gh-91873: Summarise deprecations in typing at the top level (GH-91864) 2022-04-29 12:22:25 +08:00
Eisuke Kawashima ea2f5bcda1
bpo-22276: Change pathlib.Path.glob not to ignore trailing path separator (GH-10349)
Now pathlib.Path.glob() **only** matches directories when the pattern ends in a path separator.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-28 12:45:03 -07:00
Yurii Karabas 0ef8d921f5
gh-91603: Speed up isinstance/issubclass on union types (GH-91631)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-04-28 23:24:19 +08:00
Victor Stinner 87c6cf9aa7
gh-89479: Export _Py_GetSpecializationStats() internal function (#92011)
When Python is built with "./configure --enable-pystats" (if the
Py_STATS macro is defined), the _Py_GetSpecializationStats() function
must be exported, since it's used by the _opcode extension which is
built as a shared library.
2022-04-28 14:02:45 +02:00
Brett Cannon 407c3afe19
gh-91217: deprecate uu (GH-92009)
Automerge-Triggered-By: GH:brettcannon
2022-04-27 20:26:33 -07:00
Ashwin Ramaswami f348154c8f
Add note that headers added via urllib.request.add_header are added to redirected requests (#30708) 2022-04-27 16:25:03 -06:00
slateny 161dff7e10
gh-84459: Make wording more specific for Path.replace (GH-91853)
#84459
2022-04-27 15:03:03 -07:00
David CARLIER ad9f817eeb
gh-91498: socket: Add TCP_CONNECTION_INFO on macOS (#69256)
Fixes GH-91498
2022-04-27 06:47:17 -06:00
Victor Stinner 80de0273c0
gh-68966: Deprecate the mailcap module (#91951) 2022-04-26 22:43:50 +02:00
slateny b87f7f2c21
bpo-21761: Clarify __file__/__cached__ in import reference (GH-31565)
Automerge-Triggered-By: GH:brettcannon
2022-04-26 12:12:02 -07:00
Brett Cannon 1af871eeee
gh-91217: deprecate telnetlib (GH-91958) 2022-04-26 10:45:08 -07:00
Brett Cannon d174ebe91e
gh-91217: deprecate sunau (GH-91866) 2022-04-25 16:26:43 -07:00
Gregory P. Smith cd5726fe67
gh-91401: Add a failsafe way to disable vfork. (#91490)
Just in case there is ever an issue with _posixsubprocess's use of
vfork() due to the complexity of using it properly and potential
directions that Linux platforms where it defaults to on could take, this
adds a failsafe so that users can disable its use entirely by setting
a global flag.

No known reason to disable it exists. But it'd be a shame to encounter
one and not be able to use CPython without patching and rebuilding it.

See the linked issue for some discussion on reasoning.

Also documents the existing way to disable posix_spawn.
2022-04-25 16:19:39 -07:00
Victor Stinner 20cc695286
gh-64783: Fix signal.NSIG value on FreeBSD (#91929)
Fix signal.NSIG value on FreeBSD to accept signal numbers greater
than 32, like signal.SIGRTMIN and signal.SIGRTMAX.

* Add Py_NSIG constant.
* Add pycore_signal.h internal header file.
* _Py_Sigset_Converter() now includes the range of valid signals in
  the error message.
2022-04-26 00:13:31 +02:00
Jelle Zijlstra 93d280141c
gh-90633: Improve error and docs for typing.assert_never (#91720)
Closes #90633

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-04-25 06:40:18 -07:00
Ezio Melotti f7641a2ffe
gh-91888: add a `:gh:` role to the documentation (#91889)
* Add a new :gh:`...` role for GitHub issues.

* Fix a GitHub id to use the :gh: role.

* Add Misc/NEWS entry.

* Refactoring and rephrasing.

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-04-25 12:05:54 +02:00
Jelle Zijlstra dd3cf124a0
gh-91491: What's New in 3.11 section for typing PEPs (#91721)
Other aspects of typing aren't covered yet; I'll do that in a
separate PR.
2022-04-24 14:13:15 -07:00
Zac Hatfield-Dodds b4e048411f
gh-91230: Concise catch_warnings with simplefilter (#91435) 2022-04-23 17:55:22 -07:00
Brett Cannon 692e9078a1
gh-91217: deprecate spwd (#91846)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-04-23 14:48:17 -07:00
Christian Heimes 92c1037afc
gh-84461: Add --enable-wasm-pthreads and more file systems (GH-91820) 2022-04-23 14:59:33 +02:00
Christian Heimes 9b5ca5405e
gh-84461: Add sys._emscripten_info, improve docs and build (gh-91781) 2022-04-23 09:52:16 +02:00
Pablo Galindo Salgado 0daa99f68b
gh-88116: Enhance the inspect frame APIs to use the extended position information (GH-91531) 2022-04-23 03:16:48 +01:00
slateny a3f2cf3ced
gh-85864: Mark positional-only args in io docs (#91683) 2022-04-22 17:30:52 -07:00
Shantanu 254aaa7981
gh-91547: Remove "Undocumented modules" page (#91682) 2022-04-22 16:01:52 -07:00
Brett Cannon e7929cba16
gh-91217: deprecate-sndhdr (#91806)
Also inline necessary functionality from `sndhdr` into `email.mime.audio` for `MIMEAudio`.

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-04-22 15:48:03 -07:00
Géry Ogam 5576ddbbbc
bpo-46720: Add support for path-like objects to multiprocessing.set_executable for Windows (GH-31279)
This bring the API to be on a par with Unix-like systems.
2022-04-22 15:47:09 -07:00
Dominic Davis-Foster 9fe82d0b70
gh-91764: Mark version typing.Unpack and LiteralString were added in (#91817)
Closes GH-91764
2022-04-22 07:28:39 -07:00
Erlend Egeberg Aasland 1218061609
gh-89653: PEP 670: Amend docs (GH-91813) 2022-04-22 14:59:18 +02:00
Petr Viktorin 82ec638ab7
Docs: Clarify availability of PyOS_CheckStack (GH-91816) 2022-04-22 12:44:43 +02:00
Sam Ezeh bcf14ae433
gh-91291: Accept attributes as keyword arguments in decimal.localcontext (#32242)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-21 21:27:15 -07:00
Brett Cannon 2551a6c92f
gh-91217: deprecate-pipes (GH-91779) 2022-04-21 19:28:34 -07:00
Erlend Egeberg Aasland 29afb7d2ef
gh-69093: Add indexing and slicing support to sqlite3.Blob (#91599)
Authored-by: Aviv Palivoda <palaviv@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@innova.no>
2022-04-21 18:45:16 -07:00
Inada Naoki 1317b70f89
gh-91156: Use `locale.getencoding()` instead of getpreferredencoding (GH-91732)
Co-authored-by: Victor Stinner <vstinner@python.org>
2022-04-22 10:39:24 +09:00
Victor Stinner 364ed94092
gh-89373: _Py_Dealloc() checks tp_dealloc exception (#32357)
If Python is built in debug mode, _Py_Dealloc() now ensures that the
tp_dealloc function leaves the current exception unchanged.
2022-04-21 23:04:01 +02:00
Victor Stinner eaa85cb22f
gh-91768: C API no longer use "const PyObject*" type (#91769)
Py_REFCNT(), Py_TYPE(), Py_SIZE() and Py_IS_TYPE() functions argument
type is now "PyObject*", rather than "const PyObject*".

* Replace also "const PyObject*" with "PyObject*" in functions:

  * _Py_strhex_impl()
  * _Py_strhex_with_sep()
  * _Py_strhex_bytes_with_sep()

* Remove _PyObject_CAST_CONST() and _PyVarObject_CAST_CONST() macros.
* Py_IS_TYPE() can now use Py_TYPE() in its implementation.
2022-04-21 22:07:19 +02:00
Mark Shannon d44815cabc
GH-88116: Document that PyCodeNew is dangerous, and make PyCode_NewEmpty less dangerous. (GH-91790) 2022-04-21 19:08:36 +01:00
Mark Shannon 5974827c71
GH-88756: Update docs for PEP 523 eval function type. (GH-91788) 2022-04-21 18:14:01 +01:00
Raymond Hettinger 25e35742ce
Minor improvements to grammar and markup. (GH-91762) 2022-04-20 16:02:47 -05:00
slateny ad3ca17ff5
bpo-23747: Enhance platform doc, document default behavior (GH-31462) 2022-04-20 18:23:40 +02:00
Irit Katriel f92bcfe6de
gh-89770: [PEP-678] add exception notes to tutorial (GH-30441) 2022-04-20 13:43:10 +01:00
slateny 5101d97d0b
bpo-30718: Add information about text buffering (GH-32351) 2022-04-20 17:24:53 +09:00
Raymond Hettinger 26f2e688b8
Clean-up the argparse docs quick links table (GH-91726) 2022-04-20 01:21:54 -05:00
slateny 692aea6f38
Add link to sys.path in os lib (#91679) 2022-04-19 20:59:48 -07:00
AJ Jordan 326ae71f1d
Fix awkward sentence in signal docs (#91508)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-19 18:20:25 -07:00
Irit Katriel 3c43806513
gh-74166: make all_errors keyword-only (GH-91704) 2022-04-19 18:16:20 +01:00
Victor Stinner 061a8bf77c
gh-91231: Add shutdown_timeout to multiprocessing BaseManager (#32112)
Add an optional keyword 'shutdown_timeout' parameter to the
multiprocessing.BaseManager constructor. Kill the process if
terminate() takes longer than the timeout.

Multiprocessing tests pass test.support.SHORT_TIMEOUT
to BaseManager.shutdown_timeout.
2022-04-19 16:27:00 +02:00
slateny 6a7a8a740e
Doc: Fix link formatting typo (GH-91659) 2022-04-19 18:15:46 +09:00
Victor Stinner aa5c0a9f8d
bpo-40421: Cleanup PyFrame C API (GH-32417) 2022-04-19 09:53:10 +02:00
Yurii Karabas 014eb7fd02
bpo-46014: Add docs regarding `functools.singledispatch` changes in 3.11 (#32282)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-18 19:50:59 -07:00
Irit Katriel 39a54ba638
gh-74166: Add option to get all errors from socket.create_connection (GH-91586) 2022-04-18 23:15:41 +01:00
Susan Su 8e76d7e1a9
bpo-21150: Add quick link/summary table to the top of argparse documentation (GH-12005)
No work has been done to move this forward.  On the theory that perfect is the enemy of good, I'm going to push it and we can make minor edits as needed afterwards.
2022-04-17 23:46:18 -05:00
Gouvernathor 0e6dca0193
Remove duplicate explanation (GH-91534) 2022-04-18 13:26:40 +09:00
Oleg Iarygin a573cb2fec
gh-91118: Fix docstrings that do not honor --without-doc-strings (#31769)
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-17 20:39:32 -07:00