summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* Remove "print >>obj" exception hint for Python 2 (#122853)Victor Stinner2024-08-121-32/+0
|
* gh-122903: Honor directories in zipfile.Path.glob. (#122908)Jason R. Coombs2024-08-123-9/+38
|
* gh-122905: Sanitize names in zipfile.Path. (#122906)Jason R. Coombs2024-08-112-1/+80
| | | Ported from zipp 3.19.1; ref jaraco/zipp#119.
* gh-119180: annotationlib: Fix __all__, formatting (#122365)Jelle Zijlstra2024-08-113-33/+68
|
* gh-119180: Improvements to ForwardRef.evaluate (#122210)Jelle Zijlstra2024-08-113-11/+60
| | | | Noticed some issues while writing documentation for this method.
* GH-73991: Rework `pathlib.Path.copytree()` into `copy()` (#122369)Barney Gale2024-08-116-155/+120
| | | | | | | | | | Rename `pathlib.Path.copy()` to `_copy_file()` (i.e. make it private.) Rename `pathlib.Path.copytree()` to `copy()`, and add support for copying non-directories. This simplifies the interface for users, and nicely complements the upcoming `move()` and `delete()` methods (which will also accept any type of file.) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-122858: Deprecate `asyncio.iscoroutinefunction` (#122875)Wulian2024-08-117-7/+19
| | | | | Deprecate `asyncio.iscoroutinefunction` in favor of `inspect.iscoroutinefunction`. Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-115808: Add ``is_none`` and ``is_not_none`` to ``operator`` (#115814)Nico Mexis2024-08-102-2/+30
| | | Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* gh-105376: Restore deprecated logging warn() method (#122775)Victor Stinner2024-08-091-1/+16
| | | | | | | | | This reverts commit dcc028d92428bd57358a5028ada2a53fc79fc365 and commit 6c54e5d72166d012b52155cbf13af9e533290e06. Keep the deprecated logging warn() method in Python 3.13. Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* gh-122688: Fix support of var-positional parameter in Argument Clinic ↵Serhiy Storchaka2024-08-092-17/+91
| | | | | | | | | (GH-122689) * Parameters after the var-positional parameter are now keyword-only instead of positional-or-keyword. * Correctly calculate min_kw_only. * Raise errors for invalid combinations of the var-positional parameter with "*", "/" and deprecation markers.
* gh-122835: Fix module name in ``test_typing`` (#122836)Kirill Podoprigora2024-08-081-1/+1
|
* gh-111495: Add more tests on PyEval C APIs (#122789)Victor Stinner2024-08-082-43/+103
| | | | * Add Lib/test/test_capi/test_eval.py * Add Modules/_testlimitedcapi/eval.c
* gh-122744: test_venv: ignore pip's complaint about missing ssl (GH-122776)Petr Viktorin2024-08-081-0/+8
|
* gh-122255: Add black box tests in test_warnings (GH-122227)Serhiy Storchaka2024-08-081-0/+91
| | | | They are similar to white box tests for gh-86298 in test_importlib.
* gh-116263: Do not rollover empty files in RotatingFileHandler (GH-122788)Serhiy Storchaka2024-08-082-5/+56
|
* gh-120782: Update datetime test for static type immutability (#122800)neonene2024-08-081-7/+22
|
* gh-122247: Move instruction instrumentation sanity check after tracing check ↵Tian Gao2024-08-081-0/+15
| | | | (#122251)
* gh-105201: Add PyIter_NextItem() (#122331)Erlend E. Aasland2024-08-072-0/+41
| | | | | | | | | Return -1 and set an exception on error; return 0 if the iterator is exhausted, and return 1 if the next item was fetched successfully. Prefer this API to PyIter_Next(), which requires the caller to use PyErr_Occurred() to differentiate between iterator exhaustion and errors. Co-authered-by: Irit Katriel <iritkatriel@yahoo.com>
* gh-118814: Fix the TypeVar constructor when name is passed by keyword ↵Serhiy Storchaka2024-08-072-5/+70
| | | | | | | | (GH-122664) Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for positional-or-keyword parameter is passed by keyword. There was only one such case in the stdlib -- the TypeVar constructor.
* gh-122478: Remove internal frames from tracebacks in REPL (GH-122528)Serhiy Storchaka2024-08-072-54/+158
| | | | | | | | Frames of methods in code and codeop modules was show with non-default sys.excepthook. Save correct tracebacks in sys.last_traceback and update __traceback__ attribute of sys.last_value and sys.last_exc.
* gh-118761: Improve import time of `pprint` (#122725)Hugo van Kemenade2024-08-071-4/+21
| | | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Remove dead code in the RE parser (GH-122796)Serhiy Storchaka2024-08-071-16/+0
|
* gh-122798: Make tests for warnings in the re module more strict (GH-122799)Serhiy Storchaka2024-08-071-11/+40
| | | | * Test warning messages. * Test stack level for re.compile() and re.findall().
* gh-121151: argparse: Fix wrapping of long usage text of arguments inside a ↵Ali Hamdan2024-08-072-7/+34
| | | | mutually exclusive groups (GH-121159)
* gh-79846: Make ssl.create_default_context() ignore invalid certificates ↵pukkandan2024-08-071-5/+4
| | | | | | | (GH-91740) An error in one certificate should not cause the whole thing to fail. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Fix typos in comments and docstring (#122720)Xie Yanbo2024-08-079-11/+11
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* GH-73991: Rework `pathlib.Path.rmtree()` into `delete()` (#122368)Barney Gale2024-08-074-126/+110
| | | | | | Rename `pathlib.Path.rmtree()` to `delete()`, and add support for deleting non-directories. This simplifies the interface for users, and nicely complements the upcoming `move()` and `copy()` methods (which will also accept any type of file.)
* gh-122728: Fix SystemError in PyEval_GetLocals() (#122735)Victor Stinner2024-08-061-0/+13
| | | | | | | Fix PyEval_GetLocals() to avoid SystemError ("bad argument to internal function"). Don't redefine the 'ret' variable in the if block. Add an unit test on PyEval_GetLocals().
* gh-122744: Bump bundled pip to 24.2 (#122745)Pradyun Gedam2024-08-062-1/+1
| | | Co-authored-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
* gh-122417: Implement per-thread heap type refcounts (#122418)Sam Gross2024-08-061-1/+3
| | | | | | | The free-threaded build partially stores heap type reference counts in distributed manner in per-thread arrays. This avoids reference count contention when creating or destroying instances. Co-authored-by: Ken Jin <kenjin@python.org>
* Fix duplicated words 'begins with a' in pathlib docstring (#122732)Виталий Дмитриев2024-08-061-1/+1
|
* gh-120104: IDLE: Fix padding in config and search dialogs (#120107)Serhiy Storchaka2024-08-062-2/+2
|
* gh-122058: `Lib/inspect`: Update docstrings for `isfunction`, `isgenerator`, ↵Kirill Podoprigora2024-08-061-9/+24
| | | | | | `isframe`, `iscode`. (#122059) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* Fix syntax in generate_re_casefix.py (#122699)Jelle Zijlstra2024-08-061-1/+1
| | | This was broken in gh-97963.
* gh-116622: Android logging fixes (#122698)Malcolm Smith2024-08-062-48/+212
| | | | Modifies the handling of stdout/stderr redirection on Android to accomodate the rate and buffer size limits imposed by Android's logging infrastructure.
* gh-122459: Optimize pickling by name objects without __module__ (GH-122460)Serhiy Storchaka2024-08-052-50/+49
|
* gh-122637: fix tanh(±0+infj) and tanh(±0+nanj) to return ±0+nanj (#122638)Sergey B Kirpichev2024-08-041-12/+12
| | | | | | | | | As per C11 DR#471, ctanh (0 + i NaN) and ctanh (0 + i Inf) should return 0 + i NaN (with "invalid" exception in the second case). This has corresponding implications for ctan(z), as its errors and special cases are handled as if the operation is implemented by -i*ctanh(i*z). This patch fixes cmath's code to do same. Glibs patch: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=d15e83c5f5231d971472b5ffc9219d54056ca0f1
* gh-121889: cmath.acosh(0+nanj) returns nan+pi/2j (#121892)Sergey B Kirpichev2024-08-041-2/+2
| | | | | As per C11 DR#471 (adjusted resolution accepted for C17), cacosh (0 + iNaN) should return NaN ± i pi/2, not NaN + iNaN. This patch fixes cmath's code to do same.
* gh-122334: Fix test_embed failure when missing _ssl module (GH-122630)neonene2024-08-031-2/+6
| | | Co-authored-by: Wulian233 <1055917385@qq.com>
* gh-122560: add test that comprehension loop var appears only in one scope of ↵Irit Katriel2024-08-021-0/+21
| | | | the symtable (#122582)
* gh-122527: Fix a crash on deallocation of `PyStructSequence` (GH-122577)Sam Gross2024-08-022-1/+15
| | | | | | | | | | | | | | The `PyStructSequence` destructor would crash if it was deallocated after its type's dictionary was cleared by the GC, because it couldn't compute the "real size" of the instance. This could occur with relatively straightforward code in the free-threaded build or with a reference cycle involving the type in the default build, due to differing orders in which `tp_clear()` was called. Account for the non-sequence fields in `tp_basicsize` and use that, along with `Py_SIZE()`, to compute the "real" size of a `PyStructSequence` in the dealloc function. This avoids the accesses to the type's dictionary during dealloc, which were unsafe.
* gh-122445: populate only modified fields in __static_attributes__ (#122446)Irit Katriel2024-08-021-1/+4
|
* gh-122334: Fix crash when importing ssl after re-initialization (#122481)neonene2024-08-021-0/+19
| | | | * Fix crash when importing ssl after re-initialization
* gh-121723: Relax constraints on queue objects for ↵Bénédikt Tran2024-08-022-47/+115
| | | | `logging.handlers.QueueHandler`. (GH-122154)
* gh-122188: Remove _imp.pyc_magic_number (GH-122503)Serhiy Storchaka2024-08-022-5/+7
| | | _imp.pyc_magic_number_token should be enough.
* gh-120083: Add IDLE Hovertip foreground color needed for recent macOS (#120605)John Riggles2024-08-022-2/+10
| | | | | | | | On recent versions of macOS (sometime between Catalina and Sonoma 14.5), the default Hovertip foreground color changed from black to white, thereby matching the background. This might be a matter of matching the white foreground of the dark-mode text. The unreadable result is shown here (#120083 (comment)). The foreground and background colors were made parameters so we can pass different colors for future additional hovertips in IDLE. --------- Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* Fixes typo in idlelib/idle_test/example_stub.pyi (#122520)Jonathon Vandezande2024-08-021-1/+1
| | | | --------- Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* gh-122555: Remove removed functions from `Doc/data/refcounts.dat` (#122556)Bénédikt Tran2024-08-011-1/+0
|
* GH-122155: Track local variables between pops and pushes in cases generator ↵Mark Shannon2024-08-011-8/+57
| | | | (GH-122286)
* Fix typos in docs, error messages and comments (#122502)jianghuyiyuan2024-08-011-1/+1
| | | Signed-off-by: jianghuyiyuan <shuangcui@live.com>