]>
git.ipfire.org Git - thirdparty/Python/cpython.git/log
Shantanu [Mon, 19 Sep 2022 19:09:41 +0000 (12:09 -0700)]
gh-96917: link to typing.readthedocs.io from typing.rst (#96921)
See the discussion at https://github.com/python/cpython/issues/91533
C.A.M. Gerlach [Mon, 19 Sep 2022 13:44:01 +0000 (08:44 -0500)]
gh-95913: Copyedit, link & format Typing Features section in 3.11 What's New (GH-96097)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
C.A.M. Gerlach [Mon, 19 Sep 2022 13:32:51 +0000 (08:32 -0500)]
gh-95913: Fix and copyedit New Features section of 3.11 What's New (GH-95915)
Matthias Görgens [Mon, 19 Sep 2022 07:59:13 +0000 (15:59 +0800)]
gh-96821: Fix undefined behaviour in `_testcapimodule.c` (GH-96915)
* gh-96821: Assert for demonstrating undefined behaviour
* Fix UB
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Raymond Hettinger [Sun, 18 Sep 2022 21:36:20 +0000 (16:36 -0500)]
GH-96851: Add link to FAQ entry for caching method calls. (GH-96902)
partev [Sun, 18 Sep 2022 21:35:22 +0000 (17:35 -0400)]
fix various typos in random module's documentation (GH-96912)
Scott Main [Sun, 18 Sep 2022 08:05:43 +0000 (01:05 -0700)]
gh-94787: [doc] Add to argparse doc an example of a mutually-exclusive group nested in an argument group (GH-94807)
Raymond Hettinger [Sun, 18 Sep 2022 02:09:39 +0000 (21:09 -0500)]
Clarify that the expression is regular math notation, not Python. (#96903)
Terry Jan Reedy [Sat, 17 Sep 2022 21:53:23 +0000 (17:53 -0400)]
gh-87179: Fix more IDLE class headers (#96899)
Remove unneeded '(object)' and '()'.
Guido van Rossum [Sat, 17 Sep 2022 21:12:45 +0000 (14:12 -0700)]
Revert "gh-87079: Warn on unintended signal wakeup fd override in `asyncio` (#96807)" (#96898)
This reverts commit
05878106989c6f5b9dd35a6c15a21bee59312827 .
Reason: This broke buildbots (some warnings added by that commit are turned to errors in the SSL buildbot).
Repro: ./python Lib/test/ssltests.py
Lysandros Nikolaou [Sat, 17 Sep 2022 17:09:28 +0000 (19:09 +0200)]
gh-91210: Improve error message when non-default param follows default (GH-95933)
- Improve error message when parameter without a default follows one with a default
- Show same error message when positional-only params precede the default/non-default sequence
Raymond Hettinger [Sat, 17 Sep 2022 16:31:04 +0000 (11:31 -0500)]
Simplify sieve() recipe. Add edge case tests. (GH-96892)
Michel Hidalgo [Sat, 17 Sep 2022 15:07:54 +0000 (12:07 -0300)]
gh-87079: Warn on unintended signal wakeup fd override in `asyncio` (#96807)
Warn on loop initialization, when setting the wakeup fd disturbs a previously set wakeup fd, and on loop closing, when upon resetting the wakeup fd, we find it has been changed by someone else.
Vinay Sajip [Sat, 17 Sep 2022 11:58:31 +0000 (14:58 +0300)]
gh-96861: Check for unset sys.executable during venv creation. (GH-96887)
Christian Heimes [Sat, 17 Sep 2022 11:23:39 +0000 (13:23 +0200)]
gh-96883: browser: include concurrent.futures (GH-96886)
Benjamin Peterson [Fri, 16 Sep 2022 18:26:02 +0000 (11:26 -0700)]
fixes gh-96841: replace Mercurial with VCS (#96879)
Victor Stinner [Fri, 16 Sep 2022 18:04:37 +0000 (20:04 +0200)]
gh-95778: Mention sys.set_int_max_str_digits() in error message (#96874)
When ValueError is raised if an integer is larger than the limit,
mention sys.set_int_max_str_digits() in the error message.
Serhiy Storchaka [Fri, 16 Sep 2022 14:37:30 +0000 (17:37 +0300)]
gh-96052: codeop: fix handling compiler warnings in incomplete input (GH-96132)
Previously codeop.compile_command() emitted compiler warnings (SyntaxWarning or
DeprecationWarning) and raised a SyntaxError for incomplete input containing
a potentially incorrect code. Now it always returns None for incomplete input
without emitting any warnings.
Dong-hee Na [Fri, 16 Sep 2022 10:40:05 +0000 (19:40 +0900)]
gh-89536: Use ThinLTO policy if possible (gh-96766)
Erlend E. Aasland [Thu, 15 Sep 2022 21:11:52 +0000 (23:11 +0200)]
gh-96810: Clarify for which statements sqlite3 implicitly opens transactions (#96832)
Dennis Sweeney [Thu, 15 Sep 2022 17:31:45 +0000 (13:31 -0400)]
Fix ResourceWarning in test.test_frame (GH-96831)
adphrost [Thu, 15 Sep 2022 15:42:37 +0000 (08:42 -0700)]
GH-91049: Introduce set vectorcall field API for PyFunctionObject (GH-92257)
Co-authored-by: Andrew Frost <adfrost@fb.com>
Co-authored-by: Itamar Ostricher <itamarost@gmail.com>
Nikita Sobolev [Thu, 15 Sep 2022 09:33:13 +0000 (12:33 +0300)]
gh-96751: Remove dead code from `CALL_FUNCTION_EX` opcode (GH-96752)
Ruan Comelli [Thu, 15 Sep 2022 01:33:43 +0000 (22:33 -0300)]
Fix type annotation of `pstats.FunctionProfile.ncalls` (#96741)
* fix: annotate `pstats.FunctionProfile.ncalls` as `str`
This change aligns the type annotation of `pstats.FunctionProfile.ncalls` with its runtime type.
Brandt Bucher [Thu, 15 Sep 2022 00:05:04 +0000 (17:05 -0700)]
GH-90997: Improve inline cache performance for MSVC (GH-96781)
Benjamin Peterson [Wed, 14 Sep 2022 14:59:23 +0000 (07:59 -0700)]
Revert accidental removal from 3.12 doc. (gh-96826)
Yusuke Kadowaki [Wed, 14 Sep 2022 13:34:40 +0000 (22:34 +0900)]
gh-77171 Support WAVE_FORMAT_EXTENSIBLE in the wave module (GH-96777)
The test file, a modified version of Lib/test/audiodata/pluck-pcm24.wav, was provided by Andrea Celletti on the bug tracker.
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Kevin Modzelewski [Wed, 14 Sep 2022 03:44:32 +0000 (23:44 -0400)]
ceval: Use _PyTuple_FromArraySteal in BUILD_TUPLE (GH-96516)
Nikita Sobolev [Wed, 14 Sep 2022 02:35:52 +0000 (05:35 +0300)]
gh-96784: Cover more typing special forms in `get_args()` (#96791)
Nikita Sobolev [Wed, 14 Sep 2022 02:35:16 +0000 (05:35 +0300)]
gh-96769: Cover more typing special forms to be unsubclassable (#96772)
Raymond Hettinger [Wed, 14 Sep 2022 02:10:47 +0000 (21:10 -0500)]
Itertools sieve() recipe (#96813)
Benjamin Peterson [Tue, 13 Sep 2022 22:45:12 +0000 (15:45 -0700)]
closes gh-96734: Update to Unicode 15.0.0. (GH-96809)
Dennis Sweeney [Tue, 13 Sep 2022 18:25:10 +0000 (14:25 -0400)]
gh-94808: improve comments and coverage of fastsearch.h (GH-96760)
Laurie O [Tue, 13 Sep 2022 15:56:08 +0000 (01:56 +1000)]
Add dataclass field default change to 3.11 what's new (#96790)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Alex Waygood [Tue, 13 Sep 2022 15:22:50 +0000 (16:22 +0100)]
gh-95778: Fix `sys.set_int_max_str_digits()` parameter name (#96798)
Discovered in https://github.com/python/typeshed/pull/8733
Matthias Görgens [Tue, 13 Sep 2022 13:14:35 +0000 (21:14 +0800)]
gh-96678: Fix UB of null pointer arithmetic (GH-96782)
Automerge-Triggered-By: GH:pablogsal
Matthias Görgens [Tue, 13 Sep 2022 12:15:11 +0000 (20:15 +0800)]
gh-96678: Avoid undefined behaviour in test (#96672)
Pablo Galindo Salgado [Tue, 13 Sep 2022 12:12:15 +0000 (13:12 +0100)]
gh-93503: Document the new tracing/profiling APIs in the What's new document (#96681)
Co-authored-by: Victor Stinner <vstinner@python.org>
Irit Katriel [Tue, 13 Sep 2022 12:03:41 +0000 (13:03 +0100)]
gh-87092: reduce redundancy and repetition in compiler's optimization stage (GH-96713)
Erlend E. Aasland [Tue, 13 Sep 2022 08:28:57 +0000 (10:28 +0200)]
gh-96702: Order methods before attrs in sqlite3.Connection docs (#96703)
Mark Shannon [Tue, 13 Sep 2022 08:25:16 +0000 (09:25 +0100)]
GH-96754: Check whether the interpreter frame is complete before creating frame object. (GH-96776)
Eric Snow [Mon, 12 Sep 2022 17:09:31 +0000 (11:09 -0600)]
gh-90110: Fix the c-analyzer Tool (gh-96731)
This includes:
* update the whitelists
* fixes so we can stop ignoring some of the files
* ensure Include/cpython/*.h get analyzed
adang1345 [Mon, 12 Sep 2022 14:23:13 +0000 (10:23 -0400)]
gh-96729: Ensure installers built with Tools/msi/buildrelease.bat have matching UUIDs with official releases (GH-96755)
zhanpon [Sun, 11 Sep 2022 19:56:30 +0000 (04:56 +0900)]
gh-96706: [doc] Don't recomment deprecated use of get_event_loop() in examples (#96707)
Christian Heimes [Sun, 11 Sep 2022 08:10:00 +0000 (10:10 +0200)]
gh-84461: Omit resource mod and getresuid funcs on Emscripten (GH-96303)
Christian Heimes [Sun, 11 Sep 2022 07:51:23 +0000 (09:51 +0200)]
gh-95853: Multiple ops and debug for wasm_build.py (#96744)
Dong-hee Na [Sat, 10 Sep 2022 20:44:10 +0000 (05:44 +0900)]
gh-90751: memoryview now supports half-float (#96738)
Co-authored-by: Antoine Pitrou <antoine@python.org>
Maksym Medvied [Sat, 10 Sep 2022 18:14:01 +0000 (22:14 +0400)]
Fix typo in 3.12 whatsnew (GH-96740)
Hendrik Makait [Sat, 10 Sep 2022 14:34:14 +0000 (16:34 +0200)]
gh-94972: document that shield users need to keep a reference to their task (#96724)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Mark Shannon [Sat, 10 Sep 2022 00:12:06 +0000 (01:12 +0100)]
GH-96678: Fix undefined behavior in ceval.c (#96708)
Brandt Bucher [Fri, 9 Sep 2022 21:43:10 +0000 (14:43 -0700)]
Replace ad-hoc labels with JUMP_TO_INSTRUCTION (GH-96634)
Brandt Bucher [Fri, 9 Sep 2022 21:42:29 +0000 (14:42 -0700)]
GH-90230: Fix warnings and failures with --enable-pystats (GH-96622)
Gregory P. Smith [Fri, 9 Sep 2022 19:51:34 +0000 (12:51 -0700)]
gh-96710: Make the test timing more lenient for the int/str DoS regression test. (#96717)
A regression would still absolutely fail and even a flaky pass isn't
harmful as it'd fail most of the time across our N system test runs.
Windows has a low resolution timer and CI systems are prone to odd
timing so this just gives more leeway to avoid flakiness.
Kumar Aditya [Fri, 9 Sep 2022 11:33:40 +0000 (17:03 +0530)]
Fix possible NULL pointer dereference in _PyThread_CurrentFrames (GH-96584)
Nikita Sobolev [Fri, 9 Sep 2022 08:37:02 +0000 (11:37 +0300)]
gh-96364: Fix text signatures of `__getitem__` for `list` and `dict` (GH-96365)
Dennis Sweeney [Fri, 9 Sep 2022 03:46:13 +0000 (23:46 -0400)]
gh-96624: Fix test_dotted_but_module_not_loaded in testpatch.py (GH-96691)
* Update test_dotted_but_module_not_loaded to reflect the move of unittest.test to test.test_unittest.
Guido van Rossum [Fri, 9 Sep 2022 02:32:40 +0000 (19:32 -0700)]
GH-46412: More efficient bool() for ndbm/_gdbmmodule (#96692)
Steve Dower [Thu, 8 Sep 2022 21:02:04 +0000 (22:02 +0100)]
gh-96684: Silently suppress COM security errors in _wmi module (GH-96690)
Zachary Ware [Thu, 8 Sep 2022 18:52:07 +0000 (13:52 -0500)]
gh-96465: Clear fractions hash lru_cache under refleak testing (GH-96689)
Automerge-Triggered-By: GH:zware
finefoot [Thu, 8 Sep 2022 18:51:44 +0000 (20:51 +0200)]
gh-92734: Add indentation feature to reprlib.Repr (GH-92735)
Mark Shannon [Thu, 8 Sep 2022 16:16:48 +0000 (17:16 +0100)]
GH-96636: Remove all uses of NOTRACE_DISPATCH (GH-96643)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
philg314 [Thu, 8 Sep 2022 11:12:14 +0000 (13:12 +0200)]
gh-96352: Set AttributeError context in _PyObject_GenericGetAttrWithDict (#96353)
Pablo Galindo Salgado [Thu, 8 Sep 2022 11:04:41 +0000 (12:04 +0100)]
gh-96143: Clear instruction cache after mprotect call (#96476)
Victor Stinner [Thu, 8 Sep 2022 10:20:22 +0000 (12:20 +0200)]
gh-96652: Fix faulthandler chained signal without sigaction() (#96666)
Fix the faulthandler implementation of faulthandler.register(signal,
chain=True) if the sigaction() function is not available: don't call
the previous signal handler if it's NULL.
Itamar Ostricher [Thu, 8 Sep 2022 08:22:32 +0000 (01:22 -0700)]
gh-96653: Remove duplicate CALL_STAT_INC(inlined_py_calls) in BINARY_SUBSCR_GETITEM (GH-96654)
Vinay Sajip [Thu, 8 Sep 2022 07:22:33 +0000 (08:22 +0100)]
gh-88287: Add BufferingFormatter documentation. (GH-96608)
Kumar Aditya [Wed, 7 Sep 2022 22:02:08 +0000 (03:32 +0530)]
GH-90699: use statically allocated interned strings in typeobject's slotdefs (GH-94706)
Steve Dower [Wed, 7 Sep 2022 21:53:33 +0000 (22:53 +0100)]
gh-96665: Fixes build break on older MSVC versions due to C++20 features in argument clinic (GH-96667)
Michael Droettboom [Wed, 7 Sep 2022 21:23:54 +0000 (17:23 -0400)]
gh-96268: Fix loading invalid UTF-8 (#96270)
This makes tokenizer.c:valid_utf8 match stringlib/codecs.h:decode_utf8.
It also fixes an off-by-one error introduced in 3.10 for the line number when the tokenizer reports bad UTF8.
Charlie Zhao [Wed, 7 Sep 2022 20:26:53 +0000 (04:26 +0800)]
gh-94781: Fix Windows projects not cleaning intermediate and output files for frozen modules (GH-96423)
Steve Dower [Wed, 7 Sep 2022 20:09:20 +0000 (21:09 +0100)]
gh-89545: Updates platform module to use new internal _wmi module on Windows to directly query OS properties (GH-96289)
Steve Dower [Wed, 7 Sep 2022 17:01:35 +0000 (18:01 +0100)]
gh-96577: Fixes buffer overrun in _msi module (GH-96633)
Raymond Hettinger [Wed, 7 Sep 2022 15:31:50 +0000 (10:31 -0500)]
GH-96465: Cache hashes for Fraction instances (GH-96483)
Irit Katriel [Wed, 7 Sep 2022 13:01:57 +0000 (14:01 +0100)]
gh-88057: in compile.c, assertion that stackdepth is alway >=0 is missing in one place (GH-96513)
Michael Droettboom [Wed, 7 Sep 2022 11:51:50 +0000 (07:51 -0400)]
gh-94808: Improve coverage of _PyBytes_FormatEx (GH-95895)
There were two specific areas not covered:
- %(name) syntax
- %*s syntax
Automerge-Triggered-By: GH:iritkatriel
Nikita Sobolev [Wed, 7 Sep 2022 11:13:07 +0000 (14:13 +0300)]
gh-96641: Do not expose `KeyWrapper` in `_functoolsmodule.c` (gh-96642)
Brandt Bucher [Wed, 7 Sep 2022 04:07:20 +0000 (21:07 -0700)]
GH-91432: Remove the iterator_exhausted_no_error label (GH-96517)
Dennis Sweeney [Tue, 6 Sep 2022 23:37:18 +0000 (19:37 -0400)]
gh-96538: Fix refleak in _bisectmodule.c (gh-96619)
Irit Katriel [Tue, 6 Sep 2022 23:24:34 +0000 (00:24 +0100)]
gh-96628: remove deprecated and ignored arg of sysconfig.is_python_build() (GH-96629)
Michael Droettboom [Tue, 6 Sep 2022 23:12:16 +0000 (19:12 -0400)]
gh-96611: Fix error message for invalid UTF-8 in mid-multiline string (#96623)
Kumar Aditya [Tue, 6 Sep 2022 18:02:41 +0000 (23:32 +0530)]
GH-96572: fix use after free in trace refs build mode (#96618)
Mark Shannon [Tue, 6 Sep 2022 16:37:47 +0000 (17:37 +0100)]
GH-96612: Skip incomplete frames in tracemalloc traces. (GH-96613)
Jelle Zijlstra [Tue, 6 Sep 2022 16:33:09 +0000 (09:33 -0700)]
gh-96478: Fix new test when run in refleak mode (#96615)
./python.exe -m test -R : test.test_typing would fail, apparently
because the dictionary used in the @patch decorator was modified.
Mark Shannon [Tue, 6 Sep 2022 15:45:43 +0000 (16:45 +0100)]
GH-96569: Add two NULL checks to avoid undefined behavior. (GH-96585)
Brandt Bucher [Tue, 6 Sep 2022 11:11:38 +0000 (04:11 -0700)]
GH-93911: Fix `LOAD_ATTR_PROPERTY` caches (GH-96519)
Nikita Sobolev [Mon, 5 Sep 2022 21:35:05 +0000 (00:35 +0300)]
gh-96478: Test `@overload` on C functions (#96479)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Jonathon Reinhart [Mon, 5 Sep 2022 21:32:23 +0000 (17:32 -0400)]
argparse: Remove unused name variable when handling ArgumentTypeError (#96549)
This removes the unused `name` variable in the block where `ArgumentTypeError` is handled.
`ArgumentTypeError` errors are handled by showing just the string of the exception; unlike `ValueError`, the name (`__name__`) of the function is not included in the error message.
Fixes #96548
Irit Katriel [Mon, 5 Sep 2022 21:30:51 +0000 (22:30 +0100)]
[doc] Update example in traceback doc (GH-96600)
This Monty Python reference is of-its-time. It could seem inappropriate in the context of today's sensibilities around mental health.
Automerge-Triggered-By: GH:iritkatriel
Jason R. Coombs [Mon, 5 Sep 2022 19:37:51 +0000 (15:37 -0400)]
gh-93963: Remove ResourceReaderDefaultsTests (GH-96598)
Automerge-Triggered-By: GH:jaraco
Steve Dower [Mon, 5 Sep 2022 19:06:30 +0000 (20:06 +0100)]
gh-96559: Fixes Windows launcher handling of defaults using old-style tags, and adds What's New section (GH-96595)
Ned Deily [Mon, 5 Sep 2022 18:37:24 +0000 (14:37 -0400)]
Add upstream openssl 1.1.1q patch for trivial build error on macOS (GH-96594)
Shantanu [Mon, 5 Sep 2022 17:14:50 +0000 (10:14 -0700)]
gh-92986: Fix ast.unparse when ImportFrom.level is None (#92992)
This doesn't happen naturally, but is allowed by the ASDL and compiler.
We don't want to change ASDL for backward compatibility reasons
(#57645, #92987)
Nikita Sobolev [Mon, 5 Sep 2022 16:54:09 +0000 (19:54 +0300)]
gh-96587: Raise `SyntaxError` for PEP654 on older `feature_version` (#96588)
Vinay Sajip [Mon, 5 Sep 2022 06:47:47 +0000 (07:47 +0100)]
gh-84095: Fill documentation gap regarding user-defined objects. (GH-96574)
Dennis Sweeney [Mon, 5 Sep 2022 05:02:29 +0000 (01:02 -0400)]
gh-96538: Move some type-checking out of bisect.bisect() loops (GH-96539)
Pamela Fox [Mon, 5 Sep 2022 01:33:50 +0000 (18:33 -0700)]
gh-93973: Add all_errors to asyncio.create_connection (#93974)
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
Dennis Sweeney [Sun, 4 Sep 2022 23:00:24 +0000 (19:00 -0400)]
ceval.c's GETITEM should have asserts, not set exceptions (GH-96518)
Erlend E. Aasland [Sun, 4 Sep 2022 21:34:45 +0000 (23:34 +0200)]
Docs: alphabetically order sqlite3.Cursor attrs (#96565)
Mark Dickinson [Sun, 4 Sep 2022 16:21:18 +0000 (17:21 +0100)]
gh-95778: Correctly pre-check for int-to-str conversion (#96537)
Converting a large enough `int` to a decimal string raises `ValueError` as expected. However, the raise comes _after_ the quadratic-time base-conversion algorithm has run to completion. For effective DOS prevention, we need some kind of check before entering the quadratic-time loop. Oops! =)
The quick fix: essentially we catch _most_ values that exceed the threshold up front. Those that slip through will still be on the small side (read: sufficiently fast), and will get caught by the existing check so that the limit remains exact.
The justification for the current check. The C code check is:
```c
max_str_digits / (3 * PyLong_SHIFT) <= (size_a - 11) / 10
```
In GitHub markdown math-speak, writing $M$ for `max_str_digits`, $L$ for `PyLong_SHIFT` and $s$ for `size_a`, that check is:
$$\left\lfloor\frac{M}{3L}\right\rfloor \le \left\lfloor\frac{s - 11}{10}\right\rfloor$$
From this it follows that
$$\frac{M}{3L} < \frac{s-1}{10}$$
hence that
$$\frac{L(s-1)}{M} > \frac{10}{3} > \log_2(10).$$
So
$$2^{L(s-1)} > 10^M.$$
But our input integer $a$ satisfies $|a| \ge 2^{L(s-1)}$, so $|a|$ is larger than $10^M$. This shows that we don't accidentally capture anything _below_ the intended limit in the check.
<!-- gh-issue-number: gh-95778 -->
* Issue: gh-95778
<!-- /gh-issue-number -->
Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
Ikko Ashimine [Sun, 4 Sep 2022 13:17:26 +0000 (22:17 +0900)]
no-issue: Fix typo in 3.11.0a7.rst (gh-96547)
accross -> across