summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* gh-114099: Additions to standard library to support iOS (GH-117052)Russell Keith-Magee2024-03-2811-18/+367
| | | | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Malcolm Smith <smith@chaquo.com> Co-authored-by: Ned Deily <nad@python.org>
* gh-89739: gh-77140: Support zip64 in zipimport (GH-94146)Tim Hatch2024-03-283-39/+144
| | | | | | | | | | | | | | | * Reads zip64 files as produced by the zipfile module * Include tests (somewhat slow, however, because of the need to create "large" zips) * About the same amount of strictness reading invalid zip files as zipfile has * Still works on files with prepended data (like pex) There are a lot more test cases at https://github.com/thatch/zipimport64/ that give me confidence that this works for real-world files. Fixes #89739 and #77140. --------- Co-authored-by: Itamar Ostricher <itamarost@gmail.com> Reviewed-by: Gregory P. Smith <greg@krypto.org>
* gh-108277: Make test_os tolerate 10 ms diff for timerfd on Android emulators ↵Malcolm Smith2024-03-271-13/+20
| | | | (#117223)
* gh-113317: Change how Argument Clinic lists converters (#116853)Victor Stinner2024-03-271-0/+1
| | | | | | | | | | * Add a new create_parser_namespace() function for PythonParser to pass objects to executed code. * In run_clinic(), list converters using 'converters' and 'return_converters' dictionarties. * test_clinic: add 'object()' return converter. * Use also create_parser_namespace() in eval_ast_expr(). Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-71042: Add `platform.android_ver` (#116674)Malcolm Smith2024-03-276-15/+123
|
* gh-117225: doctest: only print "and X failed" when non-zero, don't pluralise ↵Hugo van Kemenade2024-03-272-43/+62
| | | | "1 items" (#117228)
* gh-113548: Allow CLI arguments to `pdb -m` (#113557)Tian Gao2024-03-272-9/+24
|
* gh-104242: Enable test_is_char_device_true in pathlib test on all platform ↵AN Long2024-03-261-5/+5
| | | | (GH-116983)
* gh-115775: Compiler adds __static_attributes__ field to classes (#115913)Irit Katriel2024-03-267-10/+74
|
* gh-97901 add missing text/rtf to mimetypes (GH-97902)Antonio2024-03-262-0/+2
| | | | Co-authored-by: Noam Cohen <noam@noam.me>
* gh-115538: Use isolate mode when running venv ↵AN Long2024-03-261-1/+1
| | | | | test_multiprocessing_recursion() (#117116) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-98966: Handle stdout=subprocess.STDOUT (GH-98967)Paulo Neves2024-03-262-0/+10
| | | | | | | Explicitly handle the case where stdout=STDOUT as otherwise the existing error handling gets confused and reports hard to understand errors. Signed-off-by: Paulo Neves <ptsneves@gmail.com>
* gh-66543: Fix mimetype.guess_type() (GH-117217)Serhiy Storchaka2024-03-263-9/+41
| | | | | | | | | | Fix parsing of the following corner cases: * URLs with only a host name * URLs containing a fragment * URLs containing a query * filenames with only a UNC sharepoint on Windows Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* GH-117108: Set the "old space bit" to "visited" for all young objects (#117213)Mark Shannon2024-03-261-23/+1
| | | | Change old space bit of young objects from 0 to gcstate->visited_space. This ensures that any object created *and* collected during cycle GC has the bit set correctly.
* bpo-24612: Improve syntax error for 'not' after an operator (GH-28170)Pablo Galindo Salgado2024-03-261-0/+43
| | | Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* gh-83845: Add tests for operator module (#115883)Hugo van Kemenade2024-03-261-0/+47
| | | | Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
* gh-115627: Fix PySSL_SetError handling SSL_ERROR_SYSCALL (GH-115628)yevgeny hong2024-03-261-13/+15
| | | | | | | | | | | | | | | | | Python 3.10 changed from using SSL_write() and SSL_read() to SSL_write_ex() and SSL_read_ex(), but did not update handling of the return value. Change error handling so that the return value is not examined. OSError (not EOF) is now returned when retval is 0. According to *recent* man pages of all functions for which we call PySSL_SetError, (in OpenSSL 3.0 and 1.1.1), their return value should be used to determine whether an error happened (i.e. if PySSL_SetError should be called), but not what kind of error happened (so, PySSL_SetError shouldn't need retval). To get the error, we need to use SSL_get_error. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-83434: Disable XML in regrtest when -R option is used (#117232)Victor Stinner2024-03-262-1/+31
|
* gh-117187: Fix XML tests for vanilla Expat <2.6.0 (GH-117203)Sebastian Pipping2024-03-262-9/+8
| | | | | | | | | | | This fixes XML unittest fallout from the https://github.com/python/cpython/issues/115398 security fix. When configured using `--with-system-expat` on systems with older pre 2.6.0 versions of libexpat, our unittests were failing. * sax|etree: Simplify Expat version guard where simplifiable Idea by Matěj Cepl * sax|etree: Fix reparse deferral tests for vanilla Expat <2.6.0 This *does not fix* the case of distros with an older version of libexpat with the 2.6.0 feature backported as a security fix. (Ubuntu is a known example of this with its libexpat1 2.5.0-2ubunutu0.1 package)
* gh-109870: Dataclasses: batch up exec calls (gh-110851)Eric V. Smith2024-03-251-144/+182
| | | Instead of calling `exec()` once for each function added to a dataclass, only call `exec()` once per dataclass. This can lead to speed improvements of up to 20%.
* gh-117114: Make os.path.isdevdrive available on all platforms (GH-117115)Nice Zombies2024-03-253-44/+34
|
* gh-116936: Add PyType_GetModuleByDef() to the limited C API (#116937)Victor Stinner2024-03-251-0/+1
|
* gh-87193: Support bytes objects with refcount > 1 in _PyBytes_Resize() ↵Serhiy Storchaka2024-03-251-0/+30
| | | | | (GH-117160) Create a new bytes object and destroy the old one if it has refcount > 1.
* gh-112948: Make pdb completion similar to repl completion (#112950)Tian Gao2024-03-252-15/+79
|
* gh-112571: Move fish venv activation script into the common folder (GH-117169)Totally a booplicate2024-03-241-0/+0
| | | | | | | pythongh-112571: allow using fish venv activation script on windows The fish shell can be used on windows under cygwin or msys2. This change moves the script to the common folder so the venv module will install it on both posix and nt systems (like the bash script).
* Add cumulative option for the new statistics.kde() function. (#117033)Raymond Hettinger2024-03-242-16/+67
|
* gh-112383: teach dis how to interpret ENTER_EXECUTOR (#117171)Irit Katriel2024-03-233-28/+35
|
* gh-117180: Complete call sequence when trace stack overflow (GH-117184)Ken Jin2024-03-231-0/+26
| | | | | | | --------- Co-authored-by: Peter Lazorchak <lazorchakp@gmail.com> Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com> Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
* gh-91227: Ignore ERROR_PORT_UNREACHABLE in proactor recvfrom() (#32011)Erik Soma2024-03-233-12/+172
|
* gh-117008: Fix functools test_recursive_pickle() (#117009)Victor Stinner2024-03-231-2/+4
| | | | | | | Use support.infinite_recursion() in test_recursive_pickle() of test_functools to prevent a stack overflow on "ARM64 Windows Non-Debug" buildbot. Lower Py_C_RECURSION_LIMIT to 1,000 frames on Windows ARM64.
* GH-117108: Change the size of the GC increment to about 1% of the total heap ↵Mark Shannon2024-03-221-10/+25
| | | | size. (GH-117120)
* gh-113024: C API: Add PyObject_GenericHash() function (GH-113025)Serhiy Storchaka2024-03-221-0/+6
|
* gh-117084: Fix ZIP file extraction for directory entry names with ↵Serhiy Storchaka2024-03-223-1/+25
| | | | backslashes on Windows (GH-117129)
* gh-117134: Microoptimize glob() for include_hidden=True (GH-117135)Serhiy Storchaka2024-03-221-2/+2
|
* [docs] Fix typo in docstring and add example to logging cookbook. (GH-117157)Vinay Sajip2024-03-221-1/+1
|
* GH-113171: Fix "private" (non-global) IP address ranges (GH-113179)Jakub Stasiak2024-03-222-7/+55
| | | | | | | | | | | | | | | | | | | | | * GH-113171: Fix "private" (really non-global) IP address ranges The _private_networks variables, used by various is_private implementations, were missing some ranges and at the same time had overly strict ranges (where there are more specific ranges considered globally reachable by the IANA registries). This patch updates the ranges with what was missing or otherwise incorrect. I left 100.64.0.0/10 alone, for now, as it's been made special in [1] and I'm not sure if we want to undo that as I don't quite understand the motivation behind it. The _address_exclude_many() call returns 8 networks for IPv4, 121 networks for IPv6. [1] https://github.com/python/cpython/issues/61602
* gh-117127: glob tests: Reopen dir_fd to pick up directory changes (GH-117128)Petr Viktorin2024-03-221-0/+9
|
* gh-117061: Fix test_posix.test_sched_setaffinity() on RHEL9 (#117126)Victor Stinner2024-03-211-1/+10
| | | On RHEL9, sched_setaffinity(0, []) does not fail.
* gh-116333: Relax error string text expectations in SSL-related tests (GH-116334)Will Childs-Klein2024-03-213-38/+93
| | | | | | | | | | | | | | | | | | | * Relax error string text expectations in SSL-related tests As suggested [here][1], this change relaxes the OpenSSL error string text expectations in a number of tests. This was specifically done in support of more easily building CPython [AWS-LC][2], but because AWS-LC is a fork of [BoringSSL][3], it should increase compatibility with that library as well. In addition to the error string relaxations, we also add some guards around the `tls-unique` channel binding being used with TLSv1.3, as that feature (described in [RFC 6929][4]) is [not defined][5] for TLSv1.3. [1]: https://discuss.python.org/t/support-building-ssl-and-hashlib-modules-against-aws-lc/44505/4 [2]: https://github.com/aws/aws-lc [3]: https://github.com/google/boringssl [4]: https://datatracker.ietf.org/doc/html/rfc5929#section-3 [5]: https://datatracker.ietf.org/doc/html/rfc8446#appendix-C.5
* gh-76785: Drop PyInterpreterID_Type (gh-117101)Eric Snow2024-03-211-88/+220
| | | I added it quite a while ago as a strategy for managing interpreter lifetimes relative to the PEP 554 (now 734) implementation. Relatively recently I refactored that implementation to no longer rely on InterpreterID objects. Thus now I'm removing it.
* gh-115754: Add Py_GetConstant() function (#116883)Victor Stinner2024-03-212-0/+56
| | | | | | | | | | | | Add Py_GetConstant() and Py_GetConstantBorrowed() functions. In the limited C API version 3.13, getting Py_None, Py_False, Py_True, Py_Ellipsis and Py_NotImplemented singletons is now implemented as function calls at the stable ABI level to hide implementation details. Getting these constants still return borrowed references. Add _testlimitedcapi/object.c and test_capi/test_object.py to test Py_GetConstant() and Py_GetConstantBorrowed() functions.
* gh-76785: Clean Up Interpreter ID Conversions (gh-117048)Eric Snow2024-03-211-2/+2
| | | Mostly we unify the two different implementations of the conversion code (from PyObject * to int64_t. We also drop the PyArg_ParseTuple()-style converter function, as well as rename and move PyInterpreterID_LookUp().
* gh-71052: Implement `ctypes.util.find_library` on Android (GH-116379)Malcolm Smith2024-03-212-0/+32
|
* gh-116987: Support class code objects in inspect.findsource() (GH-117025)Tian Gao2024-03-213-9/+10
|
* GH-109653: Defer import of ``importlib.metadata._adapters`` (#109829)Adam Turner2024-03-212-3/+7
| | | | | | | | | | | * adapters * Add comments for deferred imports with links to rationale. * Add blurb --------- Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* gh-117089: Apply changes from importlib_metadata 7.1.0 (#117094)Jason R. Coombs2024-03-219-95/+207
| | | | | * Apply changes from importlib_metadata 7.1.0 * Include the data sources in the makefile (even though they're not needed)
* gh-116869: Enable -Werror in test_cext for Free Threading (#117106)Victor Stinner2024-03-201-5/+7
| | | | Check for warnings, but don't enable the compiler flag -Werror=declaration-after-statement.
* gh-117089: Move importlib.metadata tests to their own package (#117092)Jason R. Coombs2024-03-2012-1/+3
| | | | | | | | | * Ensure importlib.metadata tests do not leak references in sys.modules. * Move importlib.metadata tests to their own package for easier syncing with importlib_metadata. * Update owners and makefile for new directories. * Add blurb
* gh-114314: ctypes: remove stgdict and switch to heap types (GH-116458)Petr Viktorin2024-03-208-7/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, ctypes classes used a custom dict subclass, `StgDict`, as their `tp_dict`. This acts like a regular dict but also includes extra information about the type. This replaces stgdict by `StgInfo`, a C struct on the type, accessed by `PyObject_GetTypeData()` (PEP-697). All usage of `StgDict` (mainly variables named `stgdict`, `dict`, `edict` etc.) is converted to `StgInfo` (named `stginfo`, `info`, `einfo`, etc.). Where the dict is actually used for class attributes (as a regular PyDict), it's now called `attrdict`. This change -- not overriding `tp_dict` -- is made to make me comfortable with the next part of this PR: moving the initialization logic from `tp_new` to `tp_init`. The `StgInfo` is set up in `__init__` of each class, with a guard that prevents calling `__init__` more than once. Note that abstract classes (like `Array` or `Structure`) are created using `PyType_FromMetaclass` and do not have `__init__` called. Previously, this was done in `__new__`, which also wasn't called for abstract classes. Since `__init__` can be called from Python code or skipped, there is a tested guard to ensure `StgInfo` is initialized exactly once before it's used. Co-authored-by: neonene <53406459+neonene@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-116773: Ensure overlapped objects on Windows are not deallocated too ↵jkriegshauser2024-03-202-12/+52
| | | | early by asyncio (GH-116774)