Commit Graph

118644 Commits

Author SHA1 Message Date
Victor Stinner 2928e5dc65
gh-108494: Argument Clinic: Document how to generate code that uses the limited C API (#108584)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-08-30 16:02:48 +02:00
Victor Stinner e012cf771b
Document Python build requirements (#108646)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-08-30 15:28:58 +02:00
Hugo van Kemenade c7cef54631
gh-101100: Fix Sphinx warnings in the Logging Cookbook (#108678) 2023-08-30 14:37:45 +03:00
kato8966 38ab0dba80
Fix typo in multiprocessing docs (#108666) 2023-08-30 12:05:29 +01:00
Sebastian Rittau 6c484c39be
gh-108669: unittest: Fix documentation for TestResult.collectedDurations (#108670) 2023-08-30 09:36:59 +00:00
Corvin 400a1cebc7
gh-108590: Fix sqlite3.iterdump for invalid Unicode in TEXT columns (#108657)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-08-30 09:06:21 +00:00
Serhiy Storchaka 210a5d7b8b
Revert "gh-103224: Use the realpath of the Python executable in `test_venv` (GH-103243)" (GH-108667)
This reverts commit 85b0b0cd94.

It broke builtbots.
2023-08-30 11:41:04 +03:00
Victor Stinner 24b9bdd6ea
gh-106320: Remove private _Py_ForgetReference() (#108664)
Move the private _Py_ForgetReference() function to the internal C API
(pycore_object.h).
2023-08-30 03:34:43 +00:00
sterliakov 14ec0bb7c3
Mention Ellipsis pickling in the docs (#103660) 2023-08-30 01:11:31 +00:00
Serhiy Storchaka d08d49dd09
Revert "Use non alternate name for Kyiv (GH-108533)" (GH-108649)
This reverts commit 7659128b9d.

It broke tests on the Debian and macOS buildbots.
2023-08-29 23:08:45 +03:00
Erlend E. Aasland 0b0c1d046c
gh-108278: Deprecate passing the first param of sqlite3.Connection callback APIs by keyword (#108632)
Deprecate passing the callback callable by keyword for the following
sqlite3.Connection APIs:

- set_authorizer(authorizer_callback)
- set_progress_handler(progress_handler, ...)
- set_trace_callback(trace_callback)

The affected parameters will become positional-only in Python 3.15.
2023-08-29 22:02:12 +02:00
Alex Waygood 77e8f233ac
gh-108455: peg_generator: install two stubs packages before running mypy (#108637) 2023-08-29 20:14:08 +01:00
Erlend E. Aasland 8178a88bd8
gh-107801: Improve the accuracy of io.IOBase.seek docs (#108268)
- Add param docstrings
- Link to os.SEEK_* constants
- Mention the return value in the initial paragraph

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-29 19:13:38 +00:00
Guido van Rossum 59e46932c8
gh-108488: Initialize JUMP_BACKWARD cache to 0, not 17 (#108591)
This mis-initialization caused the executor optimization to kick in sooner than intended. It also set the lower 4 bits of the counter to `1` -- those bits are supposed to be reserved (the actual counter is in the upper 12 bits).
2023-08-29 18:14:56 +00:00
Guido van Rossum 4f22152713
gh-107557: Remove unnecessary SAVE_IP instructions (#108583)
Also remove NOP instructions.

The "stubs" are not optimized in this fashion (their SAVE_IP should always be preserved since it's where to jump next, and they don't contain NOPs by their nature).
2023-08-29 16:51:51 +00:00
Victor Stinner 83e191ba76
test_sys: remove debug print() (#108642) 2023-08-29 16:04:07 +00:00
Victor Stinner b62a76043e
gh-108638: Fix stat.filemode() when _stat is missing (#108639)
Change the pure Python implementation of stat.filemode() for unknown
file type: use "?", as done by the _stat.filemode().

test_stat skips TestFilemodeCStat if the _stat extension is missing.
2023-08-29 15:46:46 +00:00
Jochen Sprickerhof 7659128b9d
Use non alternate name for Kyiv (GH-108533)
tzdata provides Kiev as an alternative to Kyiv:

https://sources.debian.org/src/tzdata/2023c-10/backward/?hl=314#L314

But Debian moved it to the tzdata-legacy package breaking the test:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050530

This patch switches to the name provided by tzdata.
2023-08-29 18:00:43 +03:00
Serhiy Storchaka 9205dfeca5
gh-108635: Make parameters of some implementations of special methods positional-only (GH-108636) 2023-08-29 17:55:56 +03:00
Nikita Sobolev f8be2e262c
gh-108455: peg generator: Use `strict_optional=True` for `grammar_parser` (#108629) 2023-08-29 13:02:52 +01:00
Nikita Sobolev 30305d6d01
gh-108623: Fix compile warning in `Modules/_multiprocessing/semaphore.c` (#108624) 2023-08-29 13:43:11 +02:00
Victor Stinner bf08131e0a
gh-108494: Don't build _testclinic_limited with TraceRefs (#108608)
If Python is built with ./configure --with-trace-refs, don't build
the _testclinic_limited extension. The limited C API (Py_LIMITED_API)
is not compatible with Py_TRACE_REFS.
2023-08-29 13:39:42 +02:00
Victor Stinner e675e515ae
gh-108494: Argument Clinic: fix option group for Limited C API (#108574)
Use PyTuple_Size() instead of PyTuple_GET_SIZE().
2023-08-29 13:33:28 +02:00
Alex Waygood 0d140b8c5e
gh-108455: peg_generator: make the mypy config slightly stricter (#108627)
* Enable `--no-implicit-reexport`

* Enable the `truthy-bool` error code

* Enable the `ignore-without-code` error code

* Explicitly note that `--warn-unreachable` cannot yet be enabled
2023-08-29 11:23:22 +00:00
Alex Waygood c879b9fddf
gh-108455: Simplify the peg_generator mypy config (#108620)
make it easier to see exactly which options from mypy's `--strict` mode can't currently be enabled
2023-08-29 10:24:06 +00:00
Serhiy Storchaka ecb2bf02a4
gh-108617: Extend interactive session tests for sqlite3 (GH-108556) 2023-08-29 13:20:32 +03:00
Erlend E. Aasland c8847841cc
gh-108550: Fix sqlite3 CLI regression from gh-108551 (#108618) 2023-08-29 09:39:42 +00:00
Edward Schauman-Haigh 6eaddc10e9
gh-108558: Improve sqlite3 row factory tests (#108578)
Add test_sqlite_row_keys() to explicitly test sqlite3.Row.keys().

Cleanups:
- Reduce test noise by converting docstrings to regular comments
- Reduce boilerplate code by adding a setUp() method to RowFactoryTests

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-08-29 08:51:36 +00:00
Brett Cannon 5f85b443f7
GH-106176, GH-104702: Fix reference leak when importing across multiple threads (#108497) 2023-08-29 09:17:25 +02:00
Victor Stinner c780698e9b
gh-106320: Fix test_peg_generator: _Py_UniversalNewlineFgetsWithSize() (#108609)
Fix test_peg_generator by exporting the
_Py_UniversalNewlineFgetsWithSize() function.
2023-08-29 03:40:13 +00:00
Victor Stinner b6de2850f2
gh-106320: Remove private _PyObject_GetState() (#108606)
Move the private _PyObject_GetState() function to the internal C API
(pycore_object.h).
2023-08-29 03:38:51 +00:00
Victor Stinner fadc2dc7df
gh-106320: Remove private _PyOS_IsMainThread() function (#108605)
Move the following private API to the internal C API
(pycore_signal.h): _PyOS_IsMainThread() and _PyOS_SigintEvent().
2023-08-29 03:20:31 +00:00
Victor Stinner c9eefc77a7
gh-106320: Remove private _PyErr_SetKeyError() (#108607)
Move the private _PyErr_SetKeyError() function to the internal C API
(pycore_pyerrors.h).
2023-08-29 03:13:41 +00:00
Victor Stinner 921eb8ebf6
gh-106320: Remove private _PyLong_New() function (#108604)
Move the following private API to the internal C API (pycore_long.h):

* _PyLong_Copy()
* _PyLong_FromDigits()
* _PyLong_New()

No longer export most of these functions.
2023-08-29 04:59:49 +02:00
Victor Stinner 21a7420190
gh-106320: Remove private _PyGILState_GetInterpreterStateUnsafe() (#108603)
The remove private _PyGILState_GetInterpreterStateUnsafe() function
from the public C API: move it the internal C API (pycore_pystate.h).
No longer export the function.
2023-08-29 02:44:38 +00:00
Victor Stinner 07cf33ef24
gh-106320: Remove private _PyThread_at_fork_reinit() function (#108601)
Move the private function to the internal C API (pycore_pythread.h)
and no longer exports it.
2023-08-29 02:38:23 +00:00
Victor Stinner 8d8bf0b514
gh-106320: Remove private _Py_UniversalNewlineFgetsWithSize() (#108602)
The remove private _Py_UniversalNewlineFgetsWithSize() function from
the public C API: move it the internal C API (pycore_fileutils.h).
No longer export the function.
2023-08-29 02:36:50 +00:00
Victor Stinner 15c5a50797
gh-106320: Remove private pythonrun API (#108599)
Remove these private functions from the public C API:

* _PyRun_AnyFileObject()
* _PyRun_InteractiveLoopObject()
* _PyRun_SimpleFileObject()
* _Py_SourceAsString()

Move them to the internal C API: add a new pycore_pythonrun.h header
file. No longer export these functions.
2023-08-29 04:18:52 +02:00
Victor Stinner 301eb7e607
gh-106320: Remove _PyAnextAwaitable_Type from the public C API (#108597)
It's not needed to declare it in Include/iterobject.h: just use
"extern" where it's used (only in object.c).
2023-08-29 02:05:11 +00:00
Victor Stinner 39506ee565
gh-108240: Add pycore_capsule.h internal header file (#108596)
Move _PyCapsule_SetTraverse() definition to a new internal header
file: pycore_capsule.h.
2023-08-29 01:20:02 +00:00
Victor Stinner 4fb96a11db
gh-106320: Remove private _Py_Identifier API (#108593)
Remove the private _Py_Identifier type and related private functions
from the public C API:

* _PyObject_GetAttrId()
* _PyObject_LookupSpecialId()
* _PyObject_SetAttrId()
* _PyType_LookupId()
* _Py_IDENTIFIER()
* _Py_static_string()
* _Py_static_string_init()

Move them to the internal C API: add a new pycore_identifier.h header
file. No longer export these functions.
2023-08-29 02:29:46 +02:00
xzmeng 88f1c5b454
Fix misc doc typos (#108592) 2023-08-29 00:14:21 +00:00
Victor Stinner 5c68cba268
gh-108494: Build _testclinic_limited on Windows (#108589)
Add _testclinic_limited project to the Visual Studio solution:

* In "PCbuild/", copy "_asyncio.vcxproj" to "_testclinic_limited.vcxproj",
  replace "RootNamespace" with "_testclinic_limited", replace "_asyncio.c"
  with "_testclinic_limited.c".
* Open Visual Studio, open "PCbuild\pcbuild.sln", add the existing
  "PCbuild\_testclinic_limited.vcxproj" project to the solution.
* Add a dependency from "python" project to the "_testclinic_limited"
  project.
* Save and exit Visual Studio.
* Add ";_testclinic_limited" to "<TestModules Include="...">"
  in "PCbuild\pcbuild.proj".
2023-08-28 23:51:39 +00:00
Victor Stinner 0b6a4cb0df
gh-107149: Rename _PyUnstable_GetUnaryIntrinsicName() function (#108441)
* Rename _PyUnstable_GetUnaryIntrinsicName() to
  PyUnstable_GetUnaryIntrinsicName()
* Rename _PyUnstable_GetBinaryIntrinsicName()
  to PyUnstable_GetBinaryIntrinsicName().
2023-08-29 01:42:24 +02:00
Adam Turner 0bd2ba553d
GH-107603: Clinic: Pass specific attributes to ``print_block()`` (#108581) 2023-08-28 21:31:45 +00:00
Nikita Sobolev cf7ba83eb2
gh-108455: Run `mypy` on `Tools/peg_generator` (#108456)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-08-28 21:04:12 +01:00
Matthias Bussonnier f75cefd402
gh-106670: Allow Pdb to move between chained exceptions (#106676) 2023-08-28 18:31:03 +00:00
Alex Waygood 242bef459b
gh-108494: Argument clinic: Improve the `parse_file()` API (#108575)
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-08-28 18:25:16 +00:00
Guido van Rossum 47d7eba889
gh-108487: Move assert(self != NULL) down beyond DEOPT_IF() (#108510) 2023-08-28 10:17:00 -07:00
Erlend E. Aasland 4116592b6f
gh-108278: Deprecate passing the three first params as keyword args for sqlite3 UDF creation APIs (#108281)
Deprecate passing name, number of arguments, and the callable as keyword
arguments, for the following sqlite3.Connection APIs:

- create_function(name, nargs, callable, ...)
- create_aggregate(name, nargs, callable)

The affected parameters will become positional-only in Python 3.15.
2023-08-28 13:32:07 +00:00