]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agoFix rendering of audioop license in Doc/license.rst (GH-99752)
Zachary Ware [Thu, 24 Nov 2022 16:18:40 +0000 (10:18 -0600)] 
Fix rendering of audioop license in Doc/license.rst (GH-99752)

Also some cosmetic blank line additions for consistency with the
formatting of the rest of the file.

2 years agoGH-66285: skip asyncio fork tests for platforms without md5 hash (#99745)
Kumar Aditya [Thu, 24 Nov 2022 16:06:06 +0000 (21:36 +0530)] 
GH-66285: skip asyncio fork tests for platforms without md5 hash  (#99745)

Such buildbots (at the time of writing, only "AMD64 RHEL8 FIPS Only Blake2 Builtin Hash 3.x") cannot use multiprocessing with a fork server, so just skip the test there.

2 years agoGH-79033: Fix asyncio.Server.wait_closed() (#98582)
Guido van Rossum [Thu, 24 Nov 2022 15:32:58 +0000 (07:32 -0800)] 
GH-79033: Fix asyncio.Server.wait_closed() (#98582)

It was a no-op when used as recommended (after close()).

I had to debug one test (test__sock_sendfile_native_failure) --
the cleanup sequence for the test fixture was botched.

Hopefully that's not a portend of problems in user code --
this has never worked so people may well be doing this wrong. :-(

Co-authored-by: kumar aditya
2 years agogh-99240: Fix double-free bug in Argument Clinic str_converter generated code (GH...
colorfulappl [Thu, 24 Nov 2022 14:01:26 +0000 (22:01 +0800)] 
gh-99240: Fix double-free bug in Argument Clinic str_converter generated code (GH-99241)

Fix double-free bug mentioned at https://github.com/python/cpython/issues/99240,
by moving memory clean up out of "exit" label.

Automerge-Triggered-By: GH:erlend-aasland
2 years agogh-64490: Fix refcount error when arguments are packed to tuple in argument clinic...
colorfulappl [Thu, 24 Nov 2022 12:24:18 +0000 (20:24 +0800)] 
gh-64490: Fix refcount error when arguments are packed to tuple in argument clinic (#99233)

2 years agogh-99708: fix bug where compiler crashes on if expression with an empty body block...
Irit Katriel [Thu, 24 Nov 2022 10:59:07 +0000 (10:59 +0000)] 
gh-99708: fix bug where compiler crashes on if expression with an empty body block (GH-99732)

2 years agogh-94808: [coverage] Add an asynchronous generator test where the generator is alread...
zhanpon [Thu, 24 Nov 2022 09:10:38 +0000 (18:10 +0900)] 
gh-94808: [coverage] Add an asynchronous generator test where the generator is already running (#97672)

2 years agogh-98872: Fix a possible resource leak in Python 3.11.0 (GH-99047)
SQLPATCH [Thu, 24 Nov 2022 09:04:19 +0000 (17:04 +0800)] 
gh-98872: Fix a possible resource leak in Python 3.11.0 (GH-99047)

Issue: #98872

Automerge-Triggered-By: GH:kumaraditya303
2 years agogh-99706: unicodeobject: Fix padding in `PyASCIIObject.state` (GH-99707)
David Hewitt [Thu, 24 Nov 2022 08:21:59 +0000 (08:21 +0000)] 
gh-99706: unicodeobject: Fix padding in `PyASCIIObject.state` (GH-99707)

2 years agoadd Kumar Aditya as `asyncio` codeowner (GH-99744)
Kumar Aditya [Thu, 24 Nov 2022 06:56:54 +0000 (12:26 +0530)] 
add Kumar Aditya as `asyncio` codeowner (GH-99744)

Automerge-Triggered-By: GH:kumaraditya303
2 years agoGH-66285: fix forking in `asyncio` (#99539)
Kumar Aditya [Thu, 24 Nov 2022 03:40:27 +0000 (09:10 +0530)] 
GH-66285: fix forking in `asyncio` (#99539)

`asyncio` now does not shares event loop and signal wakeupfd in forked processes.

2 years agogh-96828: Add an `ssl.OP_ENABLE_KTLS` option (GH-96830)
Illia Volochii [Thu, 24 Nov 2022 02:24:09 +0000 (04:24 +0200)] 
gh-96828: Add an `ssl.OP_ENABLE_KTLS` option (GH-96830)

Expose the constant when OpenSSL defines it.

2 years agocloses gh-99508: fix `TypeError` in `Lib/importlib/_bootstrap_external.py` (GH-99635)
Nikita Sobolev [Wed, 23 Nov 2022 22:47:31 +0000 (01:47 +0300)] 
closes gh-99508: fix `TypeError` in `Lib/importlib/_bootstrap_external.py` (GH-99635)

2 years agoUpload NEWS file as artifact (#30419)
Hugo van Kemenade [Wed, 23 Nov 2022 22:32:09 +0000 (00:32 +0200)] 
Upload NEWS file as artifact (#30419)

Co-authored-by: ร‰ric <earaujo@caravan.coop>
2 years agoUse faster APIs to calculate paths at startup for Store packaged Python on Windows...
Steve Dower [Wed, 23 Nov 2022 19:50:15 +0000 (19:50 +0000)] 
Use faster APIs to calculate paths at startup for Store packaged Python on Windows (GH-99345)

2 years agogh-79315: Add Include/cpython/memoryobject.h header (#99723)
Victor Stinner [Wed, 23 Nov 2022 14:44:42 +0000 (15:44 +0100)] 
gh-79315: Add Include/cpython/memoryobject.h header (#99723)

Move non-limited C API from Include/memoryobject.h to a new
Include/cpython/memoryobject.h header file.

2 years agogh-99537: Use Py_SETREF(var, NULL) in C code (#99687)
Victor Stinner [Wed, 23 Nov 2022 13:57:50 +0000 (14:57 +0100)] 
gh-99537: Use Py_SETREF(var, NULL) in C code (#99687)

Replace "Py_DECREF(var); var = NULL;" with "Py_SETREF(var, NULL);".

2 years agogh-99619: fix error in documentation of ExceptionGroup.derive() (GH-99621)
Irit Katriel [Wed, 23 Nov 2022 10:59:52 +0000 (10:59 +0000)] 
gh-99619: fix error in documentation of ExceptionGroup.derive() (GH-99621)

2 years agoGH-95283: Add note about compilers in Mac/README.txt (#99506)
Ronald Oussoren [Wed, 23 Nov 2022 10:52:12 +0000 (11:52 +0100)] 
GH-95283: Add note about compilers in Mac/README.txt (#99506)

The build machinery assumes that the compiler that's used
to build on macOS includes an SDK that's at least as new
as the OS version on the build machine. Explicitly mention
this in Mac/README.txt.

2 years agoGH-98831: Add `macro` and `op` and their implementation to DSL (#99495)
Guido van Rossum [Wed, 23 Nov 2022 00:04:57 +0000 (16:04 -0800)] 
GH-98831: Add `macro` and `op` and their implementation to DSL (#99495)

Newly supported interpreter definition syntax:
- `op(NAME, (input_stack_effects -- output_stack_effects)) { ... }`
- `macro(NAME) = OP1 + OP2;`

Also some other random improvements:
- Convert `WITH_EXCEPT_START` to use stack effects
- Fix lexer to balk at unrecognized characters, e.g. `@`
- Fix moved output names; support object pointers in cache
- Introduce `error()` method to print errors
- Introduce read_uint16(p) as equivalent to `*p`

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2 years agogh-99300: Replace Py_INCREF() with Py_NewRef() in _elementtree.c (#99696)
Victor Stinner [Tue, 22 Nov 2022 21:17:06 +0000 (22:17 +0100)] 
gh-99300: Replace Py_INCREF() with Py_NewRef() in _elementtree.c (#99696)

* Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef()
  and Py_XNewRef() in Modules/_elementtree.c.
* Make reference counting more explicit: don't steal implicitly a
  reference on PyList_SET_ITEM(), use Py_NewRef() instead.
* Replace PyModule_AddObject() with PyModule_AddObjectRef().

2 years agogh-99650 : Updated argparse docs (GH-99653)
ram vikram singh [Tue, 22 Nov 2022 21:16:06 +0000 (02:46 +0530)] 
gh-99650 : Updated argparse docs (GH-99653)

2 years agogh-88226: Emit TARGET labels in Python/ceval.c when debugging, even if computed gotos...
Skip Montanaro [Tue, 22 Nov 2022 20:13:54 +0000 (14:13 -0600)] 
gh-88226: Emit TARGET labels in Python/ceval.c when debugging, even if computed gotos aren't enabled (GH-98265)

Keep target labels when debugging, but don't warn about lack of use.

Co-authored-by: Eryk Sun <eryksun@gmail.com>
2 years agogh-99146 struct module documentation should have more predictable examples/warnings...
Skip Montanaro [Tue, 22 Nov 2022 18:06:36 +0000 (12:06 -0600)] 
gh-99146 struct module documentation should have more predictable examples/warnings (GH-99141)

* nail down a couple examples to have more predictable output

* update a number of things, but this is really just a stash...

* added an applications section to describe typical uses for native and machine-independent formats

* make sure all format strings use a format prefix character

* responding to comments from @gpshead. Not likely finished yet.

* This got more involved than I expected...

* respond to several PR comments
* a lot of wordsmithing
* try and be more consistent in use of ``x`` vs ``'x'``
* expand examples a bit
* update the "see also" to be more up-to-date
* original examples relied on import * so present all examples as if

* reformat based on @gpshead comment (missed before)

* responding to comments

* missed this

* one more suggested edit

* wordsmithing

2 years agoUpdate Visual Studio solution to build all extension modules on F5 (GH-99667)
Steve Dower [Tue, 22 Nov 2022 17:20:47 +0000 (17:20 +0000)] 
Update Visual Studio solution to build all extension modules on F5 (GH-99667)

Without these "forward" dependencies, VS would only build as far as necessary to launch the selected project.

2 years agogh-99547: Add isjunction methods for checking if a path is a junction (GH-99548)
Charles Machalow [Tue, 22 Nov 2022 17:19:34 +0000 (09:19 -0800)] 
gh-99547: Add isjunction methods for checking if a path is a junction (GH-99548)

2 years agogh-99645: Fix a bug in handling class cleanups in unittest.TestCase (GH-99646)
Serhiy Storchaka [Tue, 22 Nov 2022 15:49:37 +0000 (17:49 +0200)] 
gh-99645: Fix a bug in handling class cleanups in unittest.TestCase (GH-99646)

Now addClassCleanup() uses separate lists for different TestCase subclasses,
and doClassCleanups() only cleans up the particular class.

2 years agogh-93937: Document PyFrame_Check and PyFrame_Type (GH-99695)
Petr Viktorin [Tue, 22 Nov 2022 15:41:57 +0000 (16:41 +0100)] 
gh-93937: Document PyFrame_Check and PyFrame_Type (GH-99695)

2 years agogh-88863: Clear ref cycles to resolve leak when asyncio.open_connection raises (...
Dong Uk, Kang [Tue, 22 Nov 2022 15:06:20 +0000 (00:06 +0900)] 
gh-88863: Clear ref cycles to resolve leak when asyncio.open_connection raises (#95739)

Break reference cycles to resolve memory leak, by
removing local exception and future instances from the frame

2 years agogh-99537: Use Py_CLEAR() function in C code (#99686)
Victor Stinner [Tue, 22 Nov 2022 14:22:55 +0000 (15:22 +0100)] 
gh-99537: Use Py_CLEAR() function in C code (#99686)

Replace "Py_XDECREF(var); var = NULL;" with "Py_CLEAR(var);".

Don't replace "Py_DECREF(var); var = NULL;" with "Py_CLEAR(var);". It
would add an useless "if (var)" test in code path where var cannot be
NULL.

2 years agogh-99537: Use Py_SETREF() function in C code (#99656)
Victor Stinner [Tue, 22 Nov 2022 13:22:22 +0000 (14:22 +0100)] 
gh-99537: Use Py_SETREF() function in C code (#99656)

Fix potential race condition in code patterns:

* Replace "Py_DECREF(var); var = new;" with "Py_SETREF(var, new);"
* Replace "Py_XDECREF(var); var = new;" with "Py_XSETREF(var, new);"
* Replace "Py_CLEAR(var); var = new;" with "Py_XSETREF(var, new);"

Other changes:

* Replace "old = var; var = new; Py_DECREF(var)"
  with "Py_SETREF(var, new);"
* Replace "old = var; var = new; Py_XDECREF(var)"
  with "Py_XSETREF(var, new);"
* And remove the "old" variable.

2 years agogh-99537: Use Py_SETREF() function in C code (#99657)
Victor Stinner [Tue, 22 Nov 2022 12:39:11 +0000 (13:39 +0100)] 
gh-99537: Use Py_SETREF() function in C code (#99657)

Fix potential race condition in code patterns:

* Replace "Py_DECREF(var); var = new;" with "Py_SETREF(var, new);"
* Replace "Py_XDECREF(var); var = new;" with "Py_XSETREF(var, new);"
* Replace "Py_CLEAR(var); var = new;" with "Py_XSETREF(var, new);"

Other changes:

* Replace "old = var; var = new; Py_DECREF(var)"
  with "Py_SETREF(var, new);"
* Replace "old = var; var = new; Py_XDECREF(var)"
  with "Py_XSETREF(var, new);"
* And remove the "old" variable.

2 years agogh-91053: Add an optional callback that is invoked whenever a function is modified...
mpage [Tue, 22 Nov 2022 12:06:44 +0000 (04:06 -0800)] 
gh-91053: Add an optional callback that is invoked whenever a function is modified (#98175)

2 years agogh-99537: Use Py_SETREF() function in longobject C code (#99655)
Victor Stinner [Tue, 22 Nov 2022 12:04:19 +0000 (13:04 +0100)] 
gh-99537: Use Py_SETREF() function in longobject C code (#99655)

Replace "Py_DECREF(var); var = new;" with "Py_SETREF(var, new);"
in longobject.c and _testcapi/long.c.

2 years agogh-99341: Cover type ignore nodes when incrementing line numbers (GH-99422)
Batuhan Taskaya [Tue, 22 Nov 2022 10:41:14 +0000 (13:41 +0300)] 
gh-99341: Cover type ignore nodes when incrementing line numbers (GH-99422)

2 years agoGH-92892: Add section about variadic functions to ctypes documentation (#99529)
Ronald Oussoren [Tue, 22 Nov 2022 10:33:37 +0000 (11:33 +0100)] 
GH-92892: Add section about variadic functions to ctypes documentation (#99529)

On some platforms, and in particular macOS/arm64, the calling
convention for variadic arguments is different from the regular
calling convention. Add a section to the documentation to document
this.

2 years agoGH-97001: Release GIL in termios extension (#99503)
Ronald Oussoren [Tue, 22 Nov 2022 10:14:23 +0000 (11:14 +0100)] 
GH-97001: Release GIL in termios extension (#99503)

Without releasing the GIL calls to termios APIs might block the entire interpreter.

2 years agogh-47146: Soft-deprecate structmember.h, expose its contents via Python.h (GH-99014)
Petr Viktorin [Tue, 22 Nov 2022 07:25:43 +0000 (08:25 +0100)] 
gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h (GH-99014)

The ``structmember.h`` header is deprecated, though it continues to be available
and there are no plans to remove it. There are no deprecation warnings. Old code
can stay unchanged (unless the extra include and non-namespaced macros bother
you greatly). Specifically, no uses in CPython are updated -- that would just be
unnecessary churn.
The ``structmember.h`` header is deprecated, though it continues to be
available and there are no plans to remove it.

Its contents are now available just by including ``Python.h``,
with a ``Py`` prefix added if it was missing:

- `PyMemberDef`, `PyMember_GetOne` and`PyMember_SetOne`
- Type macros like `Py_T_INT`, `Py_T_DOUBLE`, etc.
  (previously ``T_INT``, ``T_DOUBLE``, etc.)
- The flags `Py_READONLY` (previously ``READONLY``) and
  `Py_AUDIT_READ` (previously all uppercase)

Several items are not exposed from ``Python.h``:

- `T_OBJECT` (use `Py_T_OBJECT_EX`)
- `T_NONE` (previously undocumented, and pretty quirky)
- The macro ``WRITE_RESTRICTED`` which does nothing.
- The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of
  `Py_AUDIT_READ`.
- In some configurations, ``<stddef.h>`` is not included from ``Python.h``.
  It should be included manually when using ``offsetof()``.

The deprecated header continues to provide its original
contents under the original names.
Your old code can stay unchanged, unless the extra include and non-namespaced
macros bother you greatly.

There is discussion on the issue to rename `T_PYSSIZET` to `PY_T_SSIZE` or
similar. I chose not to do that -- users will probably copy/paste that with any
spelling, and not renaming it makes migration docs simpler.

Co-Authored-By: Alexander Belopolsky <abalkin@users.noreply.github.com>
Co-Authored-By: Matthias Braun <MatzeB@users.noreply.github.com>
2 years agogh-99662: fix typo in typing.TypeVarTuple docs (#99672)
GabrielAnguita [Tue, 22 Nov 2022 04:02:55 +0000 (01:02 -0300)] 
gh-99662: fix typo in typing.TypeVarTuple docs (#99672)

2 years agogh-99659: Use correct exceptions in sqlite3 bigmem tests (#99660)
ลukasz Langa [Mon, 21 Nov 2022 20:44:17 +0000 (21:44 +0100)] 
gh-99659: Use correct exceptions in sqlite3 bigmem tests (#99660)

The tests in question were added in 0eec6276fdcd by Serhiy. Apparently,
sqlite3 changed exceptions raised in those cases in the mean time but
the tests never ran because they require a high `-M` setting in the
test runner.

2 years agogh-98629: Fixes sys._git and sys.version creation on Windows (GH-99664)
Steve Dower [Mon, 21 Nov 2022 20:42:18 +0000 (20:42 +0000)] 
gh-98629: Fixes sys._git and sys.version creation on Windows (GH-99664)

2 years agogh-96002: Add functional test for Argument Clinic (#96178)
colorfulappl [Mon, 21 Nov 2022 14:08:45 +0000 (22:08 +0800)] 
gh-96002: Add functional test for Argument Clinic (#96178)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2 years agoAdd more details in test_unittest (GH-99626)
Serhiy Storchaka [Mon, 21 Nov 2022 11:57:30 +0000 (13:57 +0200)] 
Add more details in test_unittest (GH-99626)

2 years agogh-99578: Fix refleak in _imp.create_builtin() (#99642)
Victor Stinner [Mon, 21 Nov 2022 11:14:54 +0000 (12:14 +0100)] 
gh-99578: Fix refleak in _imp.create_builtin() (#99642)

Fix a reference bug in _imp.create_builtin() after the creation of
the first sub-interpreter for modules "builtins" and "sys".

2 years agoGH-95815: Document less specific error for os.remove (#99571)
Ronald Oussoren [Mon, 21 Nov 2022 10:08:06 +0000 (11:08 +0100)] 
GH-95815: Document less specific error for os.remove (#99571)

os.remove can raise PermissionError instead of IsADirectoryError,
when the object to be removed is a directory (in particular on
macOS).

This reverts a change done in #14262.

2 years agogh-99337: Fix compile errors with gcc 12 on macOS (#99470)
Ronald Oussoren [Mon, 21 Nov 2022 09:50:20 +0000 (10:50 +0100)] 
gh-99337: Fix compile errors with gcc 12 on macOS (#99470)

Fix a number of compile errors with GCC-12 on macOS:

1. In pylifecycle.c the compile rejects _Pragma within a declaration
2. posixmodule.c was missing a number of ..._RUNTIME macros for non-clang on macOS
3. _ctypes assumed that __builtin_available is always present on macOS

2 years agogh-90994: Improve error messages upon call arguments syntax errors (GH-96893)
Lysandros Nikolaou [Sun, 20 Nov 2022 23:15:05 +0000 (00:15 +0100)] 
gh-90994: Improve error messages upon call arguments syntax errors (GH-96893)

2 years agogh-99581: Fix a buffer overflow in the tokenizer when copying lines that fill the...
Pablo Galindo Salgado [Sun, 20 Nov 2022 20:20:03 +0000 (20:20 +0000)] 
gh-99581: Fix a buffer overflow in the tokenizer when copying lines that fill the available buffer (#99605)

2 years agogh-61460: Add a comment describing the multiprocessing.connection protocol (gh-99623)
Gregory P. Smith [Sun, 20 Nov 2022 18:20:04 +0000 (10:20 -0800)] 
gh-61460: Add a comment describing the multiprocessing.connection protocol (gh-99623)

Describe the multiprocessing connection protocol.

It isn't a good protocol, but it is what it is.  This way we can more
easily reason about making changes to it in a backwards compatible way.

2 years agogh-99211: Point to except/except* on syntax errors when mixing them (GH-99215)
Lysandros Nikolaou [Sun, 20 Nov 2022 17:11:02 +0000 (18:11 +0100)] 
gh-99211: Point to except/except* on syntax errors when mixing them (GH-99215)

Automerge-Triggered-By: GH:lysnikolaou
2 years agogh-99201: fix IndexError when initializing sysconfig config variables
Filipe Laรญns [Sat, 19 Nov 2022 20:47:09 +0000 (20:47 +0000)] 
gh-99201: fix IndexError when initializing sysconfig config variables

2 years agoDoc: Make functions.html readable again. (GH-99476)
Julien Palard [Sat, 19 Nov 2022 10:25:45 +0000 (11:25 +0100)] 
Doc: Make functions.html readable again. (GH-99476)

2 years ago gh-99284: [ctypes] remove `_use_broken_old_ctypes_structure_semantics_` (GH-99285)
Nikita Sobolev [Sat, 19 Nov 2022 06:25:32 +0000 (09:25 +0300)] 
 gh-99284: [ctypes] remove `_use_broken_old_ctypes_structure_semantics_` (GH-99285)

It was untested and undocumented. No code has been found in the wild that ever used it.

2 years agogh-85073: Add some missing links to source (GH-99363)
Stanley [Fri, 18 Nov 2022 19:33:40 +0000 (11:33 -0800)] 
gh-85073: Add some missing links to source (GH-99363)

Add some missing links to source from Python docs

2 years agoDoc: Replace question mark with fullstop (#99558)
Rafael Fontenelle [Fri, 18 Nov 2022 19:24:23 +0000 (16:24 -0300)] 
Doc: Replace question mark with fullstop (#99558)

The sentence "Set the LC_CTYPE locale to the user preferred locale." should end with a period
instead of a question mark.

2 years agoDoc: Fix broken link to emscripten networking website (#99531)
Alexander Ryabov [Fri, 18 Nov 2022 18:57:04 +0000 (21:57 +0300)] 
Doc: Fix broken link to emscripten networking website (#99531)

There was an extra `>` in the url.

2 years agogh-99553: fix bug where an ExceptionGroup subclass can wrap a BaseException (GH-99572)
Irit Katriel [Fri, 18 Nov 2022 15:44:43 +0000 (15:44 +0000)] 
gh-99553: fix bug where an ExceptionGroup subclass can wrap a BaseException (GH-99572)

2 years agogh-99442: Fix handling in py.exe launcher when argv[0] does not include a file extens...
Steve Dower [Fri, 18 Nov 2022 14:14:56 +0000 (14:14 +0000)] 
gh-99442: Fix handling in py.exe launcher when argv[0] does not include a file extension (GH-99542)

2 years agoGH-98831: Refactor and fix cases generator (#99526)
Guido van Rossum [Fri, 18 Nov 2022 01:06:07 +0000 (17:06 -0800)] 
GH-98831: Refactor and fix cases generator (#99526)

Also complete cache effects for BINARY_SUBSCR family.

2 years agoGH-99298: Clean up attribute specializations (GH-99398)
Brandt Bucher [Thu, 17 Nov 2022 23:09:18 +0000 (15:09 -0800)] 
GH-99298: Clean up attribute specializations (GH-99398)

2 years agoGH-98686: Get rid of BINARY_OP_GENERIC and COMPARE_OP_GENERIC (GH-99399)
Brandt Bucher [Thu, 17 Nov 2022 19:36:57 +0000 (11:36 -0800)] 
GH-98686: Get rid of BINARY_OP_GENERIC and COMPARE_OP_GENERIC (GH-99399)

2 years agoAdd a macro for "inlining" new frames (GH-99490)
Brandt Bucher [Thu, 17 Nov 2022 19:36:03 +0000 (11:36 -0800)] 
Add a macro for "inlining" new frames (GH-99490)

2 years agoMisc copyedits in docs on built-in types (GH-24466)
Adorilson Bezerra [Thu, 17 Nov 2022 16:06:00 +0000 (16:06 +0000)] 
Misc copyedits in docs on built-in types (GH-24466)

# DOC: Improvements in library/stdtypes

This PR does the following:

1. Replaces :meth: by :func: around repr function
2. Adds links to Unicode Standard site
3. Makes explicit "when" you can call the `iskeyword` function. The previous text could cause confusion to readers, especially those with English as a second language. The reader could understand that the `isidentifier` method calls the `iskeyword` function. Now, it is explicit that the dev can do it.
4. Replaces a URL with an inline link.

Automerge-Triggered-By: GH:AlexWaygood
2 years agogh-93649: Split float/long tests from _testcapimodule.c (GH-99549)
Erlend E. Aasland [Thu, 17 Nov 2022 08:56:56 +0000 (09:56 +0100)] 
gh-93649: Split float/long tests from _testcapimodule.c (GH-99549)

Automerge-Triggered-By: GH:erlend-aasland
2 years agogh-99377: Revert audit events for thread state creation and free, because the GIL...
Steve Dower [Thu, 17 Nov 2022 00:24:16 +0000 (00:24 +0000)] 
gh-99377: Revert audit events for thread state creation and free, because the GIL is not properly held at these times (GH-99543)

2 years agogh-99443: `descr_set_trampoline_call` return type should be `int` not `PyObject*...
Hood Chatham [Wed, 16 Nov 2022 23:20:17 +0000 (15:20 -0800)] 
gh-99443: `descr_set_trampoline_call` return type should be `int` not `PyObject*` (#99444)

2 years agoRemove old comment (GH-99489)
Brandt Bucher [Wed, 16 Nov 2022 21:43:31 +0000 (13:43 -0800)] 
Remove old comment (GH-99489)

2 years agogh-99370: Prefer LIBDIR from sysconfig when locating libpython for test (GH-99523)
Steve Dower [Wed, 16 Nov 2022 21:41:13 +0000 (21:41 +0000)] 
gh-99370: Prefer LIBDIR from sysconfig when locating libpython for test (GH-99523)

2 years agogh-93649: Split watcher API tests from _testcapimodule.c (#99532)
Erlend E. Aasland [Wed, 16 Nov 2022 19:13:32 +0000 (20:13 +0100)] 
gh-93649: Split watcher API tests from _testcapimodule.c (#99532)

2 years agogh-81057: Move the global Dict-Related Versions to _PyRuntimeState (gh-99497)
Eric Snow [Wed, 16 Nov 2022 17:37:29 +0000 (10:37 -0700)] 
gh-81057: Move the global Dict-Related Versions to _PyRuntimeState (gh-99497)

We also move the global func version.

https://github.com/python/cpython/issues/81057

2 years agogh-99300: Replace Py_INCREF() with Py_NewRef() (#99530)
Victor Stinner [Wed, 16 Nov 2022 17:34:24 +0000 (18:34 +0100)] 
gh-99300: Replace Py_INCREF() with Py_NewRef() (#99530)

Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef()
and Py_XNewRef().

2 years agogh-99377: Add audit events for thread creation and clear (GH-99378)
Steve Dower [Wed, 16 Nov 2022 17:15:52 +0000 (17:15 +0000)] 
gh-99377: Add audit events for thread creation and clear (GH-99378)

2 years agogh-81057: Move contextvars-related Globals to _PyRuntimeState (gh-99400)
Eric Snow [Wed, 16 Nov 2022 16:54:28 +0000 (09:54 -0700)] 
gh-81057: Move contextvars-related Globals to _PyRuntimeState (gh-99400)

This is part of the effort to consolidate global variables, to make them easier to manage (and make it easier to later move some of them to PyInterpreterState).

https://github.com/python/cpython/issues/81057

2 years agogh-81057: Move More Globals in Core Code to _PyRuntimeState (gh-99516)
Eric Snow [Wed, 16 Nov 2022 16:37:14 +0000 (09:37 -0700)] 
gh-81057: Move More Globals in Core Code to _PyRuntimeState (gh-99516)

https://github.com/python/cpython/issues/81057

2 years agogh-99518: Fix escape symbol in `test_enum` (#99519)
Nikita Sobolev [Wed, 16 Nov 2022 14:06:37 +0000 (17:06 +0300)] 
gh-99518: Fix escape symbol in `test_enum` (#99519)

2 years agogh-93649: Split memory and docstring tests from _testcapimodule.c (#99517)
Erlend E. Aasland [Wed, 16 Nov 2022 13:09:10 +0000 (14:09 +0100)] 
gh-93649: Split memory and docstring tests from _testcapimodule.c (#99517)

2 years agogh-96269: static and shared ext need different deps (#96316)
Christian Heimes [Wed, 16 Nov 2022 13:03:35 +0000 (14:03 +0100)] 
gh-96269: static and shared ext need different deps (#96316)

2 years agogh-99300: Replace Py_INCREF() with Py_NewRef() (#99513)
Victor Stinner [Wed, 16 Nov 2022 09:39:47 +0000 (10:39 +0100)] 
gh-99300: Replace Py_INCREF() with Py_NewRef() (#99513)

Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef()
and Py_XNewRef().

2 years agogh-98940: Fix Mac/Extras.install.py File filter bug (#98943)
zhangbo [Wed, 16 Nov 2022 09:17:18 +0000 (17:17 +0800)] 
gh-98940: Fix Mac/Extras.install.py File filter bug (#98943)

Slightly simplify the script and fix a case issue in the name of ``.DS_Store`` files.

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years agoGH-98831: Implement basic cache effects (#99313)
Guido van Rossum [Wed, 16 Nov 2022 03:59:19 +0000 (19:59 -0800)] 
GH-98831: Implement basic cache effects (#99313)

2 years agoUpdate Windows readme.txt to clarify Visual Studio required versions (GH-99522)
Ben Kuhn [Wed, 16 Nov 2022 03:31:16 +0000 (19:31 -0800)] 
Update Windows readme.txt to clarify Visual Studio required versions (GH-99522)

This is just a minor update to add a clarification to the requirements in the Windows build readme.

Automerge-Triggered-By: GH:zooba
2 years agogh-99460 Emscripten trampolines on optimized METH_O and METH_NOARGS code paths (...
Hood Chatham [Tue, 15 Nov 2022 17:53:39 +0000 (09:53 -0800)] 
gh-99460 Emscripten trampolines on optimized METH_O and METH_NOARGS code paths (#99461)

2 years agogh-92647: [Enum] use final status to determine lookup or create (GH-99500)
Ethan Furman [Tue, 15 Nov 2022 16:49:22 +0000 (08:49 -0800)] 
gh-92647: [Enum] use final status to determine lookup or create (GH-99500)

* use final status to determine lookup or create

* ๐Ÿ“œ๐Ÿค– Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 years agogh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496)
Eric Snow [Tue, 15 Nov 2022 16:45:11 +0000 (09:45 -0700)] 
gh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496)

This is the first of several changes to consolidate non-object globals in core code.

https://github.com/python/cpython/issues/81057

2 years agoMerge the 3.12.0a2 release into main.
Thomas Wouters [Tue, 15 Nov 2022 12:38:09 +0000 (13:38 +0100)] 
Merge the 3.12.0a2 release into main.

2 years agoPost 3.12.0a2
Thomas Wouters [Tue, 15 Nov 2022 12:36:51 +0000 (13:36 +0100)] 
Post 3.12.0a2

2 years agogh-99300: Use Py_NewRef() in Python/Python-ast.c (#99499)
Victor Stinner [Tue, 15 Nov 2022 09:29:56 +0000 (10:29 +0100)] 
gh-99300: Use Py_NewRef() in Python/Python-ast.c (#99499)

Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and
Py_XNewRef() in Python/Python-ast.c.

Update Parser/asdl_c.py to regenerate code.

2 years agogh-93649: Split pytime and datetime tests from _testcapimodule.c (#99494)
Erlend E. Aasland [Tue, 15 Nov 2022 07:17:52 +0000 (08:17 +0100)] 
gh-93649: Split pytime and datetime tests from _testcapimodule.c (#99494)

2 years agogh-99370: fix test_zippath_from_non_installed_posix (GH-99483)
Kai Zhang [Tue, 15 Nov 2022 01:01:01 +0000 (09:01 +0800)] 
gh-99370: fix test_zippath_from_non_installed_posix (GH-99483)

When build with shared enabled, we need to set `LD_LIBRARY_PATH`
for the non-installed python environment in
test_zippath_from_non_installed_posix so that the python binary
and find and link the libpython.so.

2 years agoGH-99205: remove `_static` field from `PyThreadState` and `PyInterpreterState` (GH...
Kumar Aditya [Tue, 15 Nov 2022 00:35:37 +0000 (06:05 +0530)] 
GH-99205: remove `_static` field from `PyThreadState` and `PyInterpreterState` (GH-99385)

2 years agogh-81057: Move the Remaining Import State Globals to _PyRuntimeState (gh-99488)
Eric Snow [Mon, 14 Nov 2022 22:56:16 +0000 (15:56 -0700)] 
gh-81057: Move the Remaining Import State Globals to _PyRuntimeState (gh-99488)

https://github.com/python/cpython/issues/81057

2 years agogh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc...
Steve Dower [Mon, 14 Nov 2022 21:39:18 +0000 (21:39 +0000)] 
gh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module (GH-99373)

2 years agogh-93649: Split getargs tests from _testcapimodule.c (#99346)
Erlend E. Aasland [Mon, 14 Nov 2022 21:23:41 +0000 (22:23 +0100)] 
gh-93649: Split getargs tests from _testcapimodule.c (#99346)

2 years agogh-81057: Move Global Variables Holding Objects to _PyRuntimeState. (gh-99487)
Eric Snow [Mon, 14 Nov 2022 20:50:56 +0000 (13:50 -0700)] 
gh-81057: Move Global Variables Holding Objects to _PyRuntimeState. (gh-99487)

This moves nearly all remaining object-holding globals in core code (other than static types).

https://github.com/python/cpython/issues/81057

2 years agoGH-98219: reduce sleep time in `asyncio` subprocess test (#99464)
Kumar Aditya [Mon, 14 Nov 2022 19:53:11 +0000 (01:23 +0530)] 
GH-98219: reduce sleep time in `asyncio` subprocess test (#99464)

2 years agoGH-99388: add `loop_factory` parameter to `asyncio.run` (#99462)
Kumar Aditya [Mon, 14 Nov 2022 18:18:51 +0000 (23:48 +0530)] 
GH-99388: add `loop_factory` parameter to `asyncio.run` (#99462)

2 years agogh-99300: Use Py_NewRef() in PC/ directory (#99479)
Victor Stinner [Mon, 14 Nov 2022 17:49:51 +0000 (18:49 +0100)] 
gh-99300: Use Py_NewRef() in PC/ directory (#99479)

Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and
Py_XNewRef() in test C files of the PC/ directory.

2 years agogh-99300: Use Py_NewRef() in Doc/ directory (#99480)
Victor Stinner [Mon, 14 Nov 2022 17:49:14 +0000 (18:49 +0100)] 
gh-99300: Use Py_NewRef() in Doc/ directory  (#99480)

Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and
Py_XNewRef() in test C files of the Doc/ directory.

Replace PyModule_AddObject() with PyModule_AddObjectRef() to simplify
reference counting.

2 years agogh-99300: Use Py_NewRef() in Modules/ directory (#99473)
Victor Stinner [Mon, 14 Nov 2022 15:21:40 +0000 (16:21 +0100)] 
gh-99300: Use Py_NewRef() in Modules/ directory (#99473)

Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and
Py_XNewRef() in test C files of the Modules/ directory.

2 years agogh-99300: Use Py_NewRef() in Modules/ directory (#99469)
Victor Stinner [Mon, 14 Nov 2022 15:21:23 +0000 (16:21 +0100)] 
gh-99300: Use Py_NewRef() in Modules/ directory (#99469)

Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and
Py_XNewRef() in test C files of the Modules/ directory.