Serhiy Storchaka
745492355b
gh-86493: Fix possible leaks in modules initialization: _curses_panel, _decimal, posix, xxsubtype (GH-106767)
2023-07-18 09:00:22 +03:00
Serhiy Storchaka
e1c295e3da
gh-106719: Fix __annotations__ getter and setter in the type and module types (GH-106720)
...
No longer suppress arbitrary errors. Simplify the code.
2023-07-18 08:56:58 +03:00
Inada Naoki
ece3b9d12a
gh-106843: fix memleak in _PyCompile_CleanDoc ( #106846 )
2023-07-18 03:44:16 +00:00
Guido van Rossum
1e36ca63f9
Small fixes to code generator ( #106845 )
...
These repair nits I found in PR gh-106798 (issue gh-106797) and in PR gh-106716 (issue gh-106706).
2023-07-18 01:30:41 +00:00
Erlend E. Aasland
00e52acebd
gh-104683: Argument Clinic: Modernise parse_special_symbol() ( #106837 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-17 22:37:11 +00:00
Erlend E. Aasland
1654916c48
Add Erlend as CODEOWNER for Argument Clinic docs ( #106840 )
2023-07-17 22:10:03 +00:00
Erlend E. Aasland
22379c60ab
gh-106368: Increase Argument Clinic test coverage for cpp.Monitor ( #106833 )
2023-07-17 20:55:10 +00:00
Nikita Sobolev
ebf2c56b33
gh-106831: Fix NULL check of d2i_SSL_SESSION() result in _ssl.c ( #106832 )
2023-07-17 19:55:40 +00:00
Guido van Rossum
8e9a1a0322
gh-106603: Make uop struct a triple (opcode, oparg, operand) ( #106794 )
2023-07-17 12:12:33 -07:00
Mario Corchero
7e96370a94
gh-61215: threadingmock: Improve test suite to avoid race conditions ( #106822 )
...
threadingmock: Improve test suite to avoid race conditions
Simplify tests and split them into multiple tests to prevent assertions
from triggering race conditions.
Additionally, we rely on calling the mocks without delay to validate the
functionality of matching calls.
2023-07-17 18:57:40 +00:00
Guido van Rossum
2b94a05a0e
gh-106581: Add 10 new opcodes by allowing `assert(kwnames == NULL)` ( #106707 )
...
By turning `assert(kwnames == NULL)` into a macro that is not in the "forbidden" list, many instructions that formerly were skipped because they contained such an assert (but no other mention of `kwnames`) are now supported in Tier 2. This covers 10 instructions in total (all specializations of `CALL` that invoke some C code):
- `CALL_NO_KW_TYPE_1`
- `CALL_NO_KW_STR_1`
- `CALL_NO_KW_TUPLE_1`
- `CALL_NO_KW_BUILTIN_O`
- `CALL_NO_KW_BUILTIN_FAST`
- `CALL_NO_KW_LEN`
- `CALL_NO_KW_ISINSTANCE`
- `CALL_NO_KW_METHOD_DESCRIPTOR_O`
- `CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS`
- `CALL_NO_KW_METHOD_DESCRIPTOR_FAST`
2023-07-17 11:02:58 -07:00
Guido van Rossum
b2b261ab2a
gh-106529: Generate uops for POP_JUMP_IF_[NOT_]NONE ( #106796 )
...
These aren't automatically translated because (ironically)
they are macros deferring to POP_JUMP_IF_{TRUE,FALSE},
which are not viable uops (being manually translated).
The hack is that we emit IS_NONE and then set opcode and
jump to the POP_JUMP_IF_{TRUE,FALSE} translation code.
2023-07-17 10:06:05 -07:00
Victor Stinner
ad95c7253a
gh-106687: _ssl: use uint64_t for SSL options ( #106700 )
...
SSL_CTX_get_options() uses uint64_t for options:
https://www.openssl.org/docs/man3.1/man3/SSL_CTX_get_options.html
Fix this compiler warning on Windows with MSC:
conversion from 'uint64_t' to 'long', possible loss of data
2023-07-17 17:55:30 +02:00
Erlend E. Aasland
036bb73656
gh-104050: Improve Argument Clinic type annotation coverage ( #106810 )
...
Add various missing annotations in the following classes:
- BlockPrinter
- CConverter
- CLanguage
- FormatCounterFormatter
- Language
- _TextAccumulator
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-17 13:47:08 +02:00
Irit Katriel
5ecedbd266
gh-106789: avoid importing pprint from sysconfig ( #106790 )
2023-07-17 10:28:33 +01:00
Terry Jan Reedy
7aa89e505d
gh-106780: Add __match_args__ to tutorial example ( #106784 )
...
Add Point definition with this attribute before example
that needs it.
2023-07-16 23:36:03 -04:00
Raymond Hettinger
babb22da5a
Add more recipe tests. Make the factor recipe a bit faster and clearer. (GH-106817)
2023-07-16 21:37:07 -05:00
Dong-hee Na
48956cc60e
gh-106797: Remove warning logs from Python/generated_cases.c.h (gh-106798)
2023-07-17 09:09:11 +09:00
Erlend E. Aasland
383dcbebcd
gh-104050: Argument Clinic: Annotate Clinic.parse() ( #106760 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-17 00:04:10 +00:00
Nikita Sobolev
c41320701b
gh-105540: Convert `pytest` tests of `cases_generator` to regular tests ( #106713 )
2023-07-16 16:05:24 -07:00
Jean-Baptiste Poupon
4dc593477a
Fix the french used in the email documentation (GH-106279)
...
* Fix the french used in the email documentation
The french used in one of the example was either machine translated a while ago or written by someone who does not speak french. Fixed it by using grammatically correct french.
2023-07-16 19:14:08 +02:00
Grigoriev Semyon
55408f86d7
gh-105726: Add `__slots__` to `AbstractContextManager` and `AbstractAsyncContextManager` ( #106771 )
...
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2023-07-16 15:30:39 +00:00
Kevin Diem
cc25ca16ee
gh-106706: Streamline family syntax in cases generator DSL ( #106716 )
...
From `family(opname, STRUCTSIZE) = OPNAME + SPEC1 + ... + SPECn;`
to `family(OPNAME, STRUCTSIZE) = SPEC1 + ... + SPECn;`
2023-07-16 08:16:34 -07:00
Inada Naoki
e58960160f
Doc: fix section levels of devmode doc ( #106801 )
2023-07-16 21:23:54 +09:00
Simone Rubino
83bd568d2b
Doc: devmode: add -Xdev option to example ( #106253 )
2023-07-16 16:29:58 +09:00
Hugo van Kemenade
c02ee45031
Docs search: Replace jQuery with vanilla JavaScript ( #106743 )
...
* Replace jQuery with vanilla JavaScript
* Switch 'var' to 'const' or 'let'
2023-07-16 10:26:26 +03:00
Erlend E. Aasland
8c17729489
Docs: Normalize Argument Clinic How-To section capitalization ( #106788 )
2023-07-16 00:42:58 +02:00
Mathieu Dupuy
d46a42fd8e
faq/library: remove outdated section ( #105996 )
2023-07-15 13:23:10 -07:00
Raymond Hettinger
e2ec0bad67
Add more examples to the recipe docs (GH-106782)
...
Demonstrate that factor() works for large composites and large primes.
2023-07-15 14:43:09 -05:00
Jason R. Coombs
22980dc7c9
gh-106752: Sync with zipp 3.16.2 ( #106757 )
...
* gh-106752: Sync with zipp 3.16.2
* Add blurb
2023-07-15 09:21:17 -04:00
Inada Naoki
2566b74b26
gh-81283: compiler: remove indent from docstring ( #106411 )
...
Co-authored-by: Éric <merwok@netwok.org>
2023-07-15 19:33:32 +09:00
Erlend E. Aasland
bbf6297985
gh-104050: Argument Clinic: Annotate BlockParser ( #106750 )
2023-07-15 10:11:32 +00:00
Erlend E. Aasland
2d7d1aa4bc
gh-106368: Increase Argument Clinic BlockParser test coverage ( #106759 )
2023-07-15 11:28:57 +02:00
Guido van Rossum
0db85eeba7
gh-106529: Fix subtle Tier 2 edge case with list iterator ( #106756 )
...
The Tier 2 opcode _IS_ITER_EXHAUSTED_LIST (and _TUPLE)
didn't set it->it_seq to NULL, causing a subtle bug
that resulted in test_exhausted_iterator in list_tests.py
to fail when running all tests with -Xuops.
The bug was introduced in gh-106696.
Added this as an explicit test.
Also fixed the dependencies for ceval.o -- it depends on executor_cases.c.h.
2023-07-14 17:22:06 -07:00
Jason R. Coombs
03185f0c15
gh-106752: Move zipfile._path into its own package ( #106753 )
...
* gh-106752: Move zipfile._path into its own package so it may have supplementary behavior.
* Add blurb
2023-07-14 20:40:46 +00:00
Irit Katriel
fb32f35c05
gh-102799: replace internal sys.exc_info() call by sys.exception() ( #106746 )
2023-07-14 20:41:24 +01:00
Alex Waygood
89ec0e9529
gh-106745: typing docs: Clarify that removal of PEP-585 aliases is not currently planned ( #106748 )
2023-07-14 19:49:02 +01:00
J. Nick Koston
aeef8591e4
gh-106554: replace `_BaseSelectorImpl._key_from_fd` with `dict.get` ( #106555 )
2023-07-15 03:46:30 +09:00
Irit Katriel
6a70edf24c
gh-105481: expose opcode metadata via the _opcode module ( #106688 )
2023-07-14 18:41:52 +01:00
Jason R. Coombs
243fdcb40e
gh-106531: Remove importlib.resources._legacy ( #106532 )
...
* gh-106531: Remove importlib.resources._legacy
Syncs with importlib_resources 6.0.
* Remove documentation for removed functionality.
2023-07-14 13:38:28 -04:00
Erlend E. Aasland
7c95345e4f
gh-104050: Argument Clinic: Annotate `output_templates()` ( #106732 )
...
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2023-07-14 12:20:58 +00:00
Charlie Zhao
89867d2491
gh-106446: Fix failed doctest in stdtypes ( #106447 )
...
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-07-14 03:38:03 -04:00
Grant Ramsay
21d98be422
gh-105293: Do not call SSL_CTX_set_session_id_context on client side SSL context ( #105295 )
...
* gh-105293: Do not call SSL_CTX_set_session_id_context on client side SSL context
Openssl states this is a "server side only" operation.
Calling this on a client side socket can result in unexpected behavior
* Add news entry on SSL "set session id context" changes
2023-07-14 00:10:54 -07:00
Nikita Sobolev
490295d651
gh-105626: Change the default return value of `HTTPConnection.get_proxy_response_headers` ( #105628 )
2023-07-13 23:55:49 -07:00
Guido van Rossum
025995fead
gh-106529: Split FOR_ITER_{LIST,TUPLE} into uops ( #106696 )
...
Also rename `_ITER_EXHAUSTED_XXX` to `_IS_ITER_EXHAUSTED_XXX` to make it clear this is a test.
2023-07-13 17:27:35 -07:00
Alex Waygood
128a6c1d88
gh-104683: Argument clinic: use an enum to describe the different kinds of functions ( #106721 )
...
Argument clinic: use an enum to describe the different kinds of functions
2023-07-13 22:54:05 +00:00
Erlend E. Aasland
ec45c513d3
gh-106368: Increase Argument Clinic test coverage ( #106728 )
...
- improve output_parameter() coverage
- improve coverage for Function.kind
2023-07-13 22:18:32 +00:00
Ned Batchelder
f014f1567c
docs: clarify Path.suffix (GH-106650)
2023-07-13 20:24:54 +01:00
J. Nick Koston
8d2f3c36ca
gh-106664: selectors: add get() method to _SelectorMapping ( #106665 )
...
It can be used to avoid raising and catching KeyError twice via __getitem__.
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2023-07-13 19:18:53 +00:00
Guido van Rossum
e6e0ea0113
gh-106701: Move the hand-written Tier 2 uops to bytecodes.c ( #106702 )
...
This moves EXIT_TRACE, SAVE_IP, JUMP_TO_TOP, and
_POP_JUMP_IF_{FALSE,TRUE} from ceval.c to bytecodes.c.
They are no less special than before, but this way
they are discoverable o the copy-and-patch tooling.
2023-07-13 12:14:51 -07:00