summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Docs: Resolve Sphinx warnings in dis.rst (#108476)Erlend E. Aasland2023-08-253-11/+14
| | | | | - Link to the code objects reference - Suppress link to deliberately undocumented builtins.__build_class__ - Suppress links for example methods
* Datamodel: Add headings to the standard type hierarchy (#108146)Adam Turner2023-08-251-1000/+1104
| | | Dedent content according to the new layout.
* Docs: Datamodel: Merge "Notes on using __slots__" with the parent section ↵Adam Turner2023-08-251-2/+1
| | | | (#108400)
* gh-108418: Speed up bigmem compression tests in dry mode (GH-108419)Serhiy Storchaka2023-08-253-6/+6
| | | Only generate and compress small amount of random data in dry run.
* gh-108444: Remove _PyLong_AsInt() function (#108461)Victor Stinner2023-08-253-5/+2
| | | | * Update Parser/asdl_c.py to regenerate Python/Python-ast.c. * Remove _PyLong_AsInt() alias to PyLong_AsInt().
* gh-107932: Fix dis module for bytecode that does not have an associated ↵Corvin2023-08-255-405/+468
| | | | source line (GH-107988)
* gh-103384: Generalize the regex pattern `BaseConfigurator.INDEX_PATTERN` to ↵Peeyush Aggarwal2023-08-254-3/+51
| | | | | | | allow spaces and non-alphanumeric characters in keys. (GH-103391) Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Erlend E. Aasland <erlend@python.org>
* GH-108202: Document ``calendar`` exceptions (#108398)Adam Turner2023-08-251-0/+23
|
* gh-106581: Split CALL_BOUND_METHOD_EXACT_ARGS into uops (#108462)Guido van Rossum2023-08-256-35/+171
| | | Instead of using `GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS)` we just add the macro elements of the latter to the macro for the former. This requires lengthening the uops array in struct opcode_macro_expansion. (It also required changes to stacking.py that were merged already.)
* gh-106320: Remove private _PyTraceback functions (#108453)Victor Stinner2023-08-245-8/+13
| | | | | | Move private functions to the internal C API (pycore_traceback.h): * _Py_DisplaySourceLine() * _PyTraceback_Add()
* gh-107265: Ensure _PyCode_Quicken does not handle ENTER_EXECUTOR (gh-108460)Dong-hee Na2023-08-241-0/+2
|
* gh-108444: Replace _PyLong_AsInt() with PyLong_AsInt() (#108459)Victor Stinner2023-08-2418-32/+32
| | | | | | Change generated by the command: sed -i -e 's!_PyLong_AsInt!PyLong_AsInt!g' \ $(find -name "*.c" -o -name "*.h")
* gh-108444: Argument Clinic uses PyLong_AsInt() (#108458)Victor Stinner2023-08-2473-466/+467
| | | | Argument Clinic now uses the new public PyLong_AsInt(), rather than the old name _PyLong_AsInt().
* Run `mypy` when `Tools/requirements-dev.txt` changes (#108457)Nikita Sobolev2023-08-241-0/+1
|
* gh-108444: Add PyLong_AsInt() public function (#108445)Victor Stinner2023-08-2413-3/+96
| | | | | | * Rename _PyLong_AsInt() to PyLong_AsInt(). * Add documentation. * Add test. * For now, keep _PyLong_AsInt() as an alias to PyLong_AsInt().
* GH-103247: bypass the import cache on the _require_loader helperFilipe Laíns2023-08-241-1/+2
|
* gh-108447: Detect platform triplets for x86_64 GNU/Hurd (#108045)Samuel Thibault2023-08-242-0/+7
|
* gh-106320: Remove private _PySys functions (#108452)Victor Stinner2023-08-2412-8/+20
| | | | | | | | | | Move private functions to the internal C API (pycore_sysmodule.h): * _PySys_GetAttr() * _PySys_GetSizeOf() No longer export most of these functions. Fix also a typo in Include/cpython/optimizer.h: add a missing space.
* gh-106320: Remove private _PyDict functions (#108449)Victor Stinner2023-08-2412-57/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | Move private functions to the internal C API (pycore_dict.h): * _PyDictView_Intersect() * _PyDictView_New() * _PyDict_ContainsId() * _PyDict_DelItemId() * _PyDict_DelItem_KnownHash() * _PyDict_GetItemIdWithError() * _PyDict_GetItem_KnownHash() * _PyDict_HasSplitTable() * _PyDict_NewPresized() * _PyDict_Next() * _PyDict_Pop() * _PyDict_SetItemId() * _PyDict_SetItem_KnownHash() * _PyDict_SizeOf() No longer export most of these functions. Move also the _PyDictViewObject structure to the internal C API. Move dict_getitem_knownhash() function from _testcapi to the _testinternalcapi extension. Update test_capi.test_dict for this change.
* gh-106320: Remove private _PyList functions (#108451)Victor Stinner2023-08-242-4/+3
| | | | | | | | Move private functions to the internal C API (pycore_list.h): * _PyList_Extend() * _PyList_DebugMallocStats() No longer export these functions.
* gh-106581: Fix two bugs in the code generator's copy optimization (#108380)Guido van Rossum2023-08-242-20/+62
| | | | | | | | | | | | | | | | | | I was comparing the last preceding poke with the *last* peek, rather than the *first* peek. Unfortunately this bug obscured another bug: When the last preceding poke is UNUSED, the first peek disappears, leaving the variable unassigned. This is how I fixed it: - Rename CopyEffect to CopyItem. - Change CopyItem to contain StackItems instead of StackEffects. - Update those StackItems when adjusting the manager higher or lower. - Assert that those StackItems' offsets are equivalent. - Other clever things. --------- Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* gh-106320: Remove private _PyEval function (#108433)Victor Stinner2023-08-2419-12/+37
| | | | | | | | | | | | | | Move private _PyEval functions to the internal C API (pycore_ceval.h): * _PyEval_GetBuiltin() * _PyEval_GetBuiltinId() * _PyEval_GetSwitchInterval() * _PyEval_MakePendingCalls() * _PyEval_SetProfile() * _PyEval_SetSwitchInterval() * _PyEval_SetTrace() No longer export most of these functions.
* gh-80527: Change support.requires_legacy_unicode_capi() (#108438)Victor Stinner2023-08-245-16/+17
| | | | | | | | | | | | | The decorator now requires to be called with parenthesis: @support.requires_legacy_unicode_capi() instead of: @support.requires_legacy_unicode_capi The implementation now only imports _testcapi when the decorator is called, so "import test.support" no longer imports the _testcapi extension.
* gh-107211: Fix test_peg_generator (#108435)Victor Stinner2023-08-241-45/+47
| | | | | | | | Export these internal functions for test_peg_generator * _PyArena_AddPyObject() * _PyArena_Free() * _PyArena_Malloc() * _PyArena_New()
* gh-107178: Remove _testcapi.test_dict_capi() (#108436)Victor Stinner2023-08-241-191/+0
| | | | The new _testcapi.test_dict tests are more complete, _testcapi.test_dict_capi() became redundant.
* gh-106320: Remove private _PyContext_NewHamtForTests() (#108434)Victor Stinner2023-08-245-15/+17
| | | Move the function to the internal C API.
* gh-108388: Convert test_concurrent_futures to package (#108401)Victor Stinner2023-08-2414-1677/+1847
| | | Convert test_concurrent_futures to a package of sub-tests.
* gh-106320: Remove private float C API functions (#108430)Victor Stinner2023-08-242-9/+7
| | | | | | | | | | 106320: Remove private float C API functions Remove private C API functions: * _Py_parse_inf_or_nan() * _Py_string_to_number_with_underscores() Move these functions to the internal C API and no longer export them.
* gh-106320: Remove private _PyManagedBuffer_Type (#108431)Victor Stinner2023-08-244-3/+6
| | | | Remove private _PyManagedBuffer_Type variable. Move it to the internal C API and no longer export it.
* gh-106320: Remove private PyLong C API functions (#108429)Victor Stinner2023-08-2410-78/+99
| | | | | | | | | | | | | | | | Remove private PyLong C API functions: * _PyLong_AsByteArray() * _PyLong_DivmodNear() * _PyLong_Format() * _PyLong_Frexp() * _PyLong_FromByteArray() * _PyLong_FromBytes() * _PyLong_GCD() * _PyLong_Lshift() * _PyLong_Rshift() Move these functions to the internal C API. No longer export _PyLong_FromBytes() function.
* Fix a code snippet typo in asyncio docs (#108427)A2023-08-241-1/+1
|
* gh-107211: No longer export internal functions (5) (#108423)Victor Stinner2023-08-2410-39/+73
| | | | | | No longer export _PyCompile_AstOptimize() internal C API function. Change comment style to "// comment" and add comment explaining why other functions have to be exported.
* gh-107211: No longer export internal functions (7) (#108425)Victor Stinner2023-08-2410-46/+69
| | | | | | | | | No longer export _PyUnicode_FromId() internal C API function. Change comment style to "// comment" and add comment explaining why other functions have to be exported. Update Tools/build/generate_token.py to update Include/internal/pycore_token.h comments.
* gh-108308: Remove _PyDict_GetItemStringWithError() function (#108426)Victor Stinner2023-08-245-44/+36
| | | | | | | | Remove the internal _PyDict_GetItemStringWithError() function. It can now be replaced with the new public PyDict_ContainsString() and PyDict_GetItemStringRef() functions. getargs.c now now uses a strong reference for current_arg. find_keyword() returns a strong reference.
* gh-107211: No longer export internal functions (6) (#108424)Victor Stinner2023-08-248-43/+45
| | | | | | | | | | | | No longer export these 5 internal C API functions: * _PyArena_AddPyObject() * _PyArena_Free() * _PyArena_Malloc() * _PyArena_New() * _Py_FatalRefcountErrorFunc() Change comment style to "// comment" and add comment explaining why other functions have to be exported.
* gh-107211: No longer export PyTime internal functions (#108422)Victor Stinner2023-08-241-118/+146
| | | | | | | | | No longer export these 2 internal C API functions: * _PyTime_AsNanoseconds() * _PyTime_GetSystemClockWithInfo() Change comment style to "// comment" and add comment explaining why other functions have to be exported.
* gh-108240: _PyCapsule_SetTraverse() rejects NULL callbacks (#108417)Victor Stinner2023-08-241-15/+22
|
* gh-108314: Add PyDict_ContainsString() function (#108323)Victor Stinner2023-08-2410-35/+111
|
* gh-95855: Refactor platform triplet detection code, add detection for MIPS ↵Jeffery To2023-08-244-376/+265
| | | | | | | | | | | | | | | | | soft float and musl libc (#107221) - Move platform triplet detection code into Misc/platform_triplet.c - Refactor MIPS detection, use defined(__mips64) to detect MIPS64 - Compute libc values in separate section - Add detection for MIPS soft float - Add detection for musl musl supports SPE with its soft-float ABI: https://git.musl-libc.org/cgit/musl/commit/?id=7be59733d71ada3a32a98622507399253f1d5e48 Original patch by Christian Heimes. Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-107432 Update Porting Python 2 Code to Python 3 how-to (GH-107434)Daniele Procida2023-08-241-121/+94
| | | | | | | https://docs.python.org/3/howto/pyporting.html#porting-python-2-code-to-python-3 was written for another time. In this patch: - material that frames Python 3 as "new" is removed - descriptions and directions have been trimmed
* gh-108111: Flush gzip write buffer before seeking, fixing bad writes (#108341)Chris Markiewicz2023-08-244-0/+18
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-108388: Split test_multiprocessing_spawn (#108396)Victor Stinner2023-08-2419-27/+117
| | | | | | Split test_multiprocessing_fork, test_multiprocessing_forkserver and test_multiprocessing_spawn into test packages. Each package is made of 4 sub-tests: processes, threads, manager and misc. It allows running more tests in parallel and so reduce the total test duration.
* gh-108388: regrtest splits test_asyncio package (#108393)Victor Stinner2023-08-242-44/+39
| | | | | | | | | | Currently, test_asyncio package is only splitted into sub-tests when using command "./python -m test". With this change, it's also splitted when passing it on the command line: "./python -m test test_asyncio". Remove the concept of "STDTESTS". Python is now mature enough to not have to bother with that anymore. Removing STDTESTS simplify the code.
* test_peg_generator and test_freeze require cpu (#108386)Victor Stinner2023-08-233-10/+5
| | | | | | | | The test_peg_generator and test_tools.test_freeze tests now require the 'cpu' resource. Skip these tests unless the 'cpu' resource is enabled (it is disabled by default). These tests are no longer skipped if Python is built with ASAN or MSAN sanitizer.
* gh-108253: Fix reads of uninitialized memory in funcobject.c (#108383)Guido van Rossum2023-08-231-2/+2
|
* gh-108240: Add _PyCapsule_SetTraverse() internal function (#108339)Victor Stinner2023-08-233-72/+135
| | | | | The _socket extension uses _PyCapsule_SetTraverse() to visit and clear the socket type in the garbage collector. So the _socket.socket type can be cleared in some corner cases when it wasn't possible before.
* gh-70766: Mention the object getstate caveat in 3.11 What's new. (#108379)Gregory P. Smith2023-08-231-0/+4
|
* gh-108308: Use PyDict_GetItemRef() in moduleobject.c (#108381)Victor Stinner2023-08-231-28/+40
| | | | | | | | Replace PyDict_GetItemWithError() with PyDict_GetItemRef() which returns a strong reference. Cleanup also the function: move variable definition to their first assignation, rename variable names to use name longer than 1 character.
* gh-108342: Make ssl TestPreHandshakeClose more reliable (#108370)Victor Stinner2023-08-231-31/+71
| | | | | | | | | | | | | | | | | * In preauth tests of test_ssl, explicitly break reference cycles invoving SingleConnectionTestServerThread to make sure that the thread is deleted. Otherwise, the test marks the environment as altered because the threading module sees a "dangling thread" (SingleConnectionTestServerThread). This test leak was introduced by the test added for the fix of issue gh-108310. * Use support.SHORT_TIMEOUT instead of hardcoded 1.0 or 2.0 seconds timeout. * SingleConnectionTestServerThread.run() catchs TimeoutError * Fix a race condition (missing synchronization) in test_preauth_data_to_tls_client(): the server now waits until the client connect() completed in call_after_accept(). * test_https_client_non_tls_response_ignored() calls server.join() explicitly. * Replace "localhost" with server.listener.getsockname()[0].
* gh-108308: config_dict_get() uses PyDict_GetItemRef() (#108371)Victor Stinner2023-08-231-6/+19
| | | | Replace _PyDict_GetItemStringWithError() with PyDict_GetItemRef() in config_dict_get() to get a strong reference to the item.