summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gh-99537: Use Py_SETREF(var, NULL) in C code (#99687)Victor Stinner2022-11-2322-87/+44
| | | Replace "Py_DECREF(var); var = NULL;" with "Py_SETREF(var, NULL);".
* gh-99619: fix error in documentation of ExceptionGroup.derive() (GH-99621)Irit Katriel2022-11-231-6/+27
|
* GH-95283: Add note about compilers in Mac/README.txt (#99506)Ronald Oussoren2022-11-231-0/+13
| | | | | | 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.
* GH-98831: Add `macro` and `op` and their implementation to DSL (#99495)Guido van Rossum2022-11-237-135/+325
| | | | | | | | | | | | | | 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>
* gh-99300: Replace Py_INCREF() with Py_NewRef() in _elementtree.c (#99696)Victor Stinner2022-11-221-69/+36
| | | | | | | * 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().
* gh-99650 : Updated argparse docs (GH-99653)ram vikram singh2022-11-221-1/+1
|
* gh-88226: Emit TARGET labels in Python/ceval.c when debugging, even if ↵Skip Montanaro2022-11-222-4/+24
| | | | | | | 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>
* gh-99146 struct module documentation should have more predictable ↵Skip Montanaro2022-11-221-76/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Update Visual Studio solution to build all extension modules on F5 (GH-99667)Steve Dower2022-11-221-0/+44
| | | Without these "forward" dependencies, VS would only build as far as necessary to launch the selected project.
* gh-99547: Add isjunction methods for checking if a path is a junction (GH-99548)Charles Machalow2022-11-2215-24/+182
|
* gh-99645: Fix a bug in handling class cleanups in unittest.TestCase (GH-99646)Serhiy Storchaka2022-11-223-5/+35
| | | | | Now addClassCleanup() uses separate lists for different TestCase subclasses, and doClassCleanups() only cleans up the particular class.
* gh-93937: Document PyFrame_Check and PyFrame_Type (GH-99695)Petr Viktorin2022-11-221-0/+18
|
* gh-88863: Clear ref cycles to resolve leak when asyncio.open_connection ↵Dong Uk, Kang2022-11-224-14/+38
| | | | | | | raises (#95739) Break reference cycles to resolve memory leak, by removing local exception and future instances from the frame
* gh-99537: Use Py_CLEAR() function in C code (#99686)Victor Stinner2022-11-222-12/+5
| | | | | | | 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.
* gh-99537: Use Py_SETREF() function in C code (#99656)Victor Stinner2022-11-2220-89/+37
| | | | | | | | | | | | | | | 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.
* gh-99537: Use Py_SETREF() function in C code (#99657)Victor Stinner2022-11-2219-76/+34
| | | | | | | | | | | | | | | 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.
* gh-91053: Add an optional callback that is invoked whenever a function is ↵mpage2022-11-229-0/+524
| | | | modified (#98175)
* gh-99537: Use Py_SETREF() function in longobject C code (#99655)Victor Stinner2022-11-222-57/+28
| | | | Replace "Py_DECREF(var); var = new;" with "Py_SETREF(var, new);" in longobject.c and _testcapi/long.c.
* gh-99341: Cover type ignore nodes when incrementing line numbers (GH-99422)Batuhan Taskaya2022-11-223-0/+20
|
* GH-92892: Add section about variadic functions to ctypes documentation (#99529)Ronald Oussoren2022-11-222-0/+21
| | | | | | 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.
* GH-97001: Release GIL in termios extension (#99503)Ronald Oussoren2022-11-222-12/+77
| | | Without releasing the GIL calls to termios APIs might block the entire interpreter.
* gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h ↵Petr Viktorin2022-11-2219-345/+667
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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>
* gh-99662: fix typo in typing.TypeVarTuple docs (#99672)GabrielAnguita2022-11-221-1/+1
|
* gh-99659: Use correct exceptions in sqlite3 bigmem tests (#99660)Łukasz Langa2022-11-212-4/+7
| | | | | | 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.
* gh-98629: Fixes sys._git and sys.version creation on Windows (GH-99664)Steve Dower2022-11-212-1/+2
|
* gh-96002: Add functional test for Argument Clinic (#96178)colorfulappl2022-11-2112-1/+3695
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* Add more details in test_unittest (GH-99626)Serhiy Storchaka2022-11-212-35/+67
|
* gh-99578: Fix refleak in _imp.create_builtin() (#99642)Victor Stinner2022-11-213-1/+35
| | | | Fix a reference bug in _imp.create_builtin() after the creation of the first sub-interpreter for modules "builtins" and "sys".
* GH-95815: Document less specific error for os.remove (#99571)Ronald Oussoren2022-11-211-1/+1
| | | | | | | 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.
* gh-99337: Fix compile errors with gcc 12 on macOS (#99470)Ronald Oussoren2022-11-217-9/+54
| | | | | | | | 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
* gh-90994: Improve error messages upon call arguments syntax errors (GH-96893)Lysandros Nikolaou2022-11-204-1149/+1427
|
* gh-99581: Fix a buffer overflow in the tokenizer when copying lines that ↵Pablo Galindo Salgado2022-11-203-1/+25
| | | | fill the available buffer (#99605)
* gh-61460: Add a comment describing the multiprocessing.connection protocol ↵Gregory P. Smith2022-11-201-0/+68
| | | | | | | | (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.
* gh-99211: Point to except/except* on syntax errors when mixing them (GH-99215)Lysandros Nikolaou2022-11-203-674/+718
| | | Automerge-Triggered-By: GH:lysnikolaou
* gh-99201: fix IndexError when initializing sysconfig config variablesFilipe Laíns2022-11-192-1/+8
|
* Doc: Make functions.html readable again. (GH-99476)Julien Palard2022-11-191-60/+60
|
* gh-99284: [ctypes] remove `_use_broken_old_ctypes_structure_semantics_` ↵Nikita Sobolev2022-11-197-27/+7
| | | | | (GH-99285) It was untested and undocumented. No code has been found in the wild that ever used it.
* gh-85073: Add some missing links to source (GH-99363)Stanley2022-11-188-0/+22
| | | Add some missing links to source from Python docs
* Doc: Replace question mark with fullstop (#99558)Rafael Fontenelle2022-11-181-1/+1
| | | | The sentence "Set the LC_CTYPE locale to the user preferred locale." should end with a period instead of a question mark.
* Doc: Fix broken link to emscripten networking website (#99531)Alexander Ryabov2022-11-181-1/+1
| | | There was an extra `>` in the url.
* gh-99553: fix bug where an ExceptionGroup subclass can wrap a BaseException ↵Irit Katriel2022-11-184-5/+37
| | | | (GH-99572)
* gh-99442: Fix handling in py.exe launcher when argv[0] does not include a ↵Steve Dower2022-11-183-51/+44
| | | | file extension (GH-99542)
* GH-98831: Refactor and fix cases generator (#99526)Guido van Rossum2022-11-186-308/+405
| | | | Also complete cache effects for BINARY_SUBSCR family.
* GH-99298: Clean up attribute specializations (GH-99398)Brandt Bucher2022-11-175-57/+39
|
* GH-98686: Get rid of BINARY_OP_GENERIC and COMPARE_OP_GENERIC (GH-99399)Brandt Bucher2022-11-178-206/+161
|
* Add a macro for "inlining" new frames (GH-99490)Brandt Bucher2022-11-173-86/+28
|
* Misc copyedits in docs on built-in types (GH-24466)Adorilson Bezerra2022-11-171-10/+14
| | | | | | | | | | | | # 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
* gh-93649: Split float/long tests from _testcapimodule.c (GH-99549)Erlend E. Aasland2022-11-179-625/+677
| | | Automerge-Triggered-By: GH:erlend-aasland
* gh-99377: Revert audit events for thread state creation and free, because ↵Steve Dower2022-11-173-39/+1
| | | | the GIL is not properly held at these times (GH-99543)
* gh-99443: `descr_set_trampoline_call` return type should be `int` not ↵Hood Chatham2022-11-161-1/+1
| | | | `PyObject*` (#99444)