summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* gh-108308: Replace _PyDict_GetItemStringWithError() (#108372)Victor Stinner2023-08-234-39/+32
| | | | | | | Replace _PyDict_GetItemStringWithError() calls with PyDict_GetItemStringRef() which returns a strong reference to the item. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-77377: Ensure multiprocessing SemLock is valid for spawn-based Process ↵albanD2023-08-233-2/+30
| | | | | | | | | | | | before serializing it (#107275) Ensure multiprocessing SemLock is valid for spawn Process before serializing it. Creating a multiprocessing SemLock with a fork context, and then trying to pass it to a spawn-created Process, would segfault if not detected early. --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Antoine Pitrou <pitrou@free.fr>
* gh-107811: tarfile: treat overflow in UID/GID as failure to set it (#108369)Petr Viktorin2023-08-232-1/+5
|
* gh-105481: remove regen-opcode. Generated _PyOpcode_Caches in regen-cases. ↵Irit Katriel2023-08-2319-176/+78
| | | | (#108367)
* gh-107298: Fix a few more refs in the C API docs (GH-108361)Serhiy Storchaka2023-08-238-18/+18
| | | gh-107298: Fix few more refs in the C API docs
* gh-107265: Ensure de_instrument does not handle ENTER_EXECUTOR (#108366)Dong-hee Na2023-08-231-0/+1
|
* gh-108303: Move `ann_module*.py` files to `typinganndata/` folder (#108354)Nikita Sobolev2023-08-2313-8/+13
|
* gh-108308: Replace PyDict_GetItem() with PyDict_GetItemRef() (#108309)Victor Stinner2023-08-234-32/+105
| | | | | | | | | Replace PyDict_GetItem() calls with PyDict_GetItemRef() or PyDict_GetItemWithError() to handle errors. * Replace PyLong_AS_LONG() with _PyLong_AsInt() and check for errors. * Check for PyDict_Contains() error. * pycore_init_builtins() checks for _PyType_Lookup() failure.
* gh-50002: xml.dom.minidom now preserves whitespaces in attributes (GH-107947)Serhiy Storchaka2023-08-234-7/+65
| | | | Also double quotes (") are now only quoted in attributes.
* gh-105539: Fix ResourceWarning from unclosed SQLite connections in ↵Mariusz Felisiak2023-08-233-13/+16
| | | | | | | | | | | | | test_sqlite3 (#108360) Follow up to 1a1bfc28912a39b500c578e9f10a8a222638d411. Explicitly manage connections in: - test_audit.test_sqlite3 - test_sqlite3.test_audit - test_sqlite3.test_backup Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-108294: Add time.sleep audit event (GH-108298)Petr Viktorin2023-08-235-0/+38
|
* gh-108113: Make it possible to optimize an AST (#108282)Irit Katriel2023-08-236-48/+77
|
* gh-108267: Dataclasses docs: Fix object.__setattr__ typo (#108355)FrozenBob2023-08-231-1/+1
| | | | | Fixed a sentence in dataclasses.rst Changed "__setattr__" to "object.__setattr__" in a section that was specifically supposed to refer to the __setattr__ method of the object class. Also suppressed the link to the data model docs for __setattr__, since we're talking about a specific __setattr__ implementation, not __setattr__ methods in general.
* gh-108342: Break ref cycle in SSLSocket._create() exc (#108344)Victor Stinner2023-08-231-1/+5
| | | | | | | | Explicitly break a reference cycle when SSLSocket._create() raises an exception. Clear the variable storing the exception, since the exception traceback contains the variables and so creates a reference cycle. This test leak was introduced by the test added for the fix of #108310.
* gh-105776: Fix test_cppext when CC contains -std=c11 option (#108343)Victor Stinner2023-08-232-0/+15
| | | | Fix test_cppext when the C compiler command has the "-std=c11" option. Remove "-std=" options from the compiler command.
* gh-90791: test.pythoninfo logs ASAN_OPTIONS env var (#108289)Victor Stinner2023-08-223-25/+39
| | | | * Cleanup libregrtest code logging ASAN_OPTIONS. * Fix a typo on "ASAN_OPTIONS" vs "MSAN_OPTIONS".
* Fix spurious diff if the cases generator is run on Windows (#108319)Alex Waygood2023-08-221-1/+1
|
* gh-107136: Remove Plausible for docs metrics (#107856)Hugo van Kemenade2023-08-221-3/+0
|