Victor Stinner
b11a384dc7
gh-98724: Fix Py_CLEAR() macro side effects ( #99100 ) ( #100070 )
...
The Py_CLEAR(), Py_SETREF() and Py_XSETREF() macros now only evaluate
their arguments once. If an argument has side effects, these side
effects are no longer duplicated.
Use temporary variables to avoid duplicating side effects of macro
arguments. If available, use _Py_TYPEOF() to avoid type punning.
Otherwise, use memcpy() for the assignment to prevent a
miscompilation with strict aliasing caused by type punning.
Add _Py_TYPEOF() macro: __typeof__() on GCC and clang.
Add test_py_clear() and test_py_setref() unit tests to _testcapi.
2022-12-07 15:22:38 +01:00
Matěj Cepl
7031275776
gh-93018: Fix for the compatibility problems with expat (gh-93900)
2022-12-07 15:55:49 +09:00
Nikita Sobolev
889b0b9bf9
[Enum] Remove unused code from `test_enum.py` (GH-96986)
2022-12-06 18:44:47 -08:00
Pablo Galindo Salgado
97e7004cfe
gh-100050: Fix an assertion error when raising unclosed parenthesis errors in the tokenizer (GH-100065)
...
Automerge-Triggered-By: GH:pablogsal
2022-12-06 15:09:56 -08:00
Victor Stinner
abbe4482ab
PyUnicode_KIND() uses _Py_RVALUE() ( #100060 )
...
The PyUnicode_KIND() macro is modified to use _Py_RVALUE(), so it can
no longer be used as a l-value.
2022-12-06 23:40:05 +01:00
Ethan Furman
679efbb080
gh-94943: [Enum] improve repr() when inheriting from a dataclass (GH-99740)
...
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-12-06 13:43:41 -08:00
Thomas Wouters
5da5aa4c3e
Post 3.12.0a3
2022-12-06 22:20:28 +01:00
Thomas Wouters
b6bd7ffcbc
Python 3.12.0a3
2022-12-06 19:33:02 +01:00
Serhiy Storchaka
fd38a2f0ec
gh-93453: No longer create an event loop in get_event_loop() ( #98440 )
...
asyncio.get_event_loop() now always return either running event loop or
the result of get_event_loop_policy().get_event_loop() call. The latter
should now raise an RuntimeError if no current event loop was set
instead of creating and setting a new event loop.
It affects also a number of asyncio functions and constructors which
call get_event_loop() implicitly: ensure_future(), shield(), gather(),
etc.
DeprecationWarning is no longer emitted if there is no running event loop but
the current event loop was set.
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-12-06 18:42:12 +01:00
Brandt Bucher
b72014c783
GH-99729: Unlink frames before clearing them (GH-100030)
2022-12-06 14:01:38 +00:00
Ashwin Ramaswami
85d5a7e8ef
bpo-37860: re-add netlify.toml to set up deploy previews for docs ( #92852 )
...
* Revert "bpo-46184: remove `netlify.toml` (#30272 )"
This reverts commit fbaf2e604c
.
* Delete runtime.txt
* Create runtime.txt
* Delete runtime.txt
* Update netlify.toml
* Update netlify.toml
* Add netlify badge
* Update Doc/tools/templates/layout.html
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Update layout.html
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-12-06 08:37:41 -05:00
Victor Stinner
5837e5f347
gh-100008: VS 2017 is required since Python 3.11 ( #100045 )
2022-12-06 14:35:32 +01:00
Michael Droettboom
9dc787ea96
GH-100026: Include the number of raw input files in summarize_stats.py (GH-100027)
2022-12-06 11:14:47 +00:00
Erik De Bonte
5c19050546
gh-99957: Add `frozen_default` parameter on `dataclass_transform` ( #99958 )
2022-12-05 19:35:43 -08:00
Gregory P. Smith
bed15f87ea
gh-100001: Remove doc typo, add versionadded ( #100042 )
...
gh-100001: Remove new doc typo, add versionadded.
2022-12-05 15:15:13 -08:00
Gregory P. Smith
7e29398407
gh-100001: Also escape \s in http.server log messages. ( #100038 )
...
Also \ escape \s in the http.server BaseHTTPRequestHandler.log_message so
that it is technically possible to parse the line and reconstruct what the
original data was. Without this a \xHH is ambiguious as to if it is a hex
replacement we put in or the characters r"\x" came through in the original
request line.
2022-12-05 14:27:55 -08:00
Eric Snow
e9e63ad865
gh-99984: Fix Compiler Warnings ( #100036 )
...
https://github.com/python/cpython/issues/99984
2022-12-05 14:41:06 -07:00
Hugo van Kemenade
f49c735e52
Use sphinxext-opengraph to generate OpenGraph metadata ( #99931 )
...
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-12-05 23:26:28 +02:00
Gregory P. Smith
d8ab0a4dfa
gh-100001: Omit control characters in http.server stderr logs. ( #100002 )
...
Replace control characters in http.server.BaseHTTPRequestHandler.log_message with an escaped \xHH sequence to avoid causing problems for the terminal the output is printed to.
2022-12-05 12:55:45 -08:00
Eric Snow
530cc9dbb6
gh-99741: Implement Multi-Phase Init for the _xxsubinterpreters Module (gh-99742)
...
_xxsubinterpreters is an internal module used for testing.
https://github.com/python/cpython/issues/99741
2022-12-05 13:40:20 -07:00
Ram Rachum
51ee0a29e9
dataclasses.rst: Prevent horizontal scrolling (gh-100025)
2022-12-05 13:56:13 -05:00
Michael Förderer
124ecd6576
bpo-44817: Ignore additional errors in ntpath.realpath (GH-27574)
2022-12-05 17:34:00 +00:00
Petr Viktorin
f24738742c
gh-98680: Add PyBUF_* constants to the Limited API listing (GH-100018)
...
``PyBUF_*`` constants are marked as part of Limited API of Python 3.11+.
These were available in 3.11.0 with `Py_LIMITED_API` defined for 3.11,
and are necessary to use the buffer API. Omitting them in `stable_abi.toml`
was a mistake.
2022-12-05 18:02:36 +01:00
Serhiy Storchaka
922a6cf6c2
gh-60203: Revert changes in cycle.__setstate__ ( #99982 )
...
In case if only True/False be supported as boolean arguments in future,
we should continue to support 1/0 here.
2022-12-05 17:27:40 +01:00
Victor Stinner
2488c1e1b6
gh-99892: test_unicodedata: skip test on download failure ( #100011 )
...
Skip test_normalization() of test_unicodedata if it fails to download
NormalizationTest.txt file from pythontest.net.
2022-12-05 16:37:40 +01:00
Victor Stinner
5ea052bb0c
gh-100008: Document Python build requirements ( #100009 )
...
Document also configure --without-freelists option added to Python
3.11.
2022-12-05 15:41:44 +01:00
Victor Stinner
038b151963
gh-100005: Skip test_script_as_dev_fd() on FreeBSD ( #100006 )
...
On FreeBSD, skip test_script_as_dev_fd() of test_cmd_line_script if
fdescfs is not mounted (at /dev/fd).
2022-12-05 14:23:35 +01:00
Ethan Furman
e3a3863cb9
gh-93464: [Enum] Add versionchanged tag ( #99997 )
...
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-12-05 12:35:31 +02:00
Ikko Ashimine
bdc93b8a35
no-issue: Fix typo in pycore_object.h (gh-99994)
2022-12-05 14:42:38 +09:00
Felix Ye
854a878e4f
gh-98248: Normalizing the error messages in function struct.pack (GH-98252)
...
Provide consistent and informative error messages in function struct.pack when its integral arguments are not in range.
2022-12-04 20:24:18 +00:00
Géry Ogam
2ae894b6d1
[Enum] Fix typos in the documentation (GH-99960)
2022-12-04 11:49:31 -08:00
AlexTate
72ec518203
gh-98458: unittest: bugfix for infinite loop while handling chained exceptions that contain cycles ( #98459 )
...
* Bugfix addressing infinite loop while handling self-referencing chained exception in TestResult._clean_tracebacks()
* Bugfix extended to properly handle exception cycles in _clean_tracebacks. The "seen" set follows the approach used in the TracebackException class (thank you @iritkatriel for pointing it out)
* adds a test for a single chained exception that holds a self-loop in its __cause__ and __context__ attributes
2022-12-04 11:37:55 -08:00
Itamar Ostricher
1012dc1b43
GH-91054: Reset static events counts in code watchers tests ( #99978 )
2022-12-04 12:38:21 +00:00
Serhiy Storchaka
76f43fc09a
gh-60203: Always pass True/False as boolean arguments in tests (GH-99983)
...
Unless we explicitly test non-bool values.
2022-12-04 14:28:56 +02:00
Brian Skinn
bf26bdf6ac
gh-85747: "Preface" section of asyncio-eventloop.rst: Switch to active voice and suggest other edits ( #99784 )
2022-12-03 16:48:41 -08:00
Serhiy Storchaka
a87c46eab3
bpo-15999: Accept arbitrary values for boolean parameters. ( #15609 )
...
builtins and extension module functions and methods that expect boolean values for parameters now accept any Python object rather than just a bool or int type. This is more consistent with how native Python code itself behaves.
2022-12-03 11:52:21 -08:00
Alexander Kanavin
c68573b339
gh-99934: test_marshal.py: add more elements in test_deterministic_sets (GH-99935)
...
Existing elements do produce different output on x86_64, but they
do not on x86. Let's make the data longer to ensure it differs.
2022-12-03 10:53:20 -06:00
Kumar Aditya
ee60156500
GH-66285: remove redundant `time.sleep` from `test_fork_signal_handling` (GH-99963)
2022-12-02 22:15:36 -08:00
Guido van Rossum
acf9184e6b
GH-98831: Support cache effects in super- and macro instructions ( #99601 )
2022-12-02 19:57:30 -08:00
Eric Snow
0547a981ae
gh-99741: Clean Up the _xxsubinterpreters Module (gh-99940)
...
This cleanup up resolves a few subtle bugs and makes the implementation for multi-phase init much cleaner.
https://github.com/python/cpython/issues/99741
2022-12-02 11:36:57 -07:00
Irit Katriel
ab02262cd0
gh-99955: standardize return values of functions in assembler and optimizer. ( #99956 )
2022-12-02 17:43:10 +00:00
Eric Snow
b4f3505549
gh-99741: Fix the Cross-Interpreter Data API (gh-99939)
...
There were some minor issues that showed up while I was working on porting _xxsubinterpreters to multi-phase init. This fixes them.
https://github.com/python/cpython/issues/99741
2022-12-02 10:39:17 -07:00
Itamar Ostricher
3c137dc613
GH-91054: Add code object watchers API (GH-99859)
...
* Add API to allow extensions to set callback function on creation and destruction of PyCodeObject
Co-authored-by: Ye11ow-Flash <janshah@cs.stonybrook.edu>
2022-12-02 17:28:27 +00:00
Pablo Galindo Salgado
0563be23a5
gh-99894: Ensure the local names don't collide with the test file in traceback suggestion error checking ( #99895 )
...
Co-authored-by: Victor Stinner <vstinner@python.org>
2022-12-01 14:05:56 +01:00
Serhiy Storchaka
f08e52ccb0
gh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data (GH-99613)
...
Previously *consumed was not set in this case.
2022-12-01 14:54:51 +02:00
C.A.M. Gerlach
d460c8ec52
Doc: Add summary line to isolation_level & autocommit sqlite3.connect params ( #99917 )
...
Add summary lines to isolation_level and autocommit connect() params
Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2022-12-01 08:19:41 +01:00
ram vikram singh
e0f91deb59
GH-98906 ```re``` module: ```search() vs. match()``` section should mention ```fullmatch()``` (GH-98916)
...
Mention fullmatch along with search and match.
2022-11-30 17:52:21 -05:00
Serhiy Storchaka
787764219f
gh-89189: More compact range iterator (GH-27986)
2022-11-30 23:04:30 +02:00
Géry Ogam
9628136fac
bpo-47220: Document the optional callback parameter of weakref.WeakMethod (GH-25491)
2022-11-30 13:44:10 -06:00
Michael Droettboom
bf94c653f4
GH-99905: Fix output of misses in summarize_stats.py execution counts (GH-99906)
...
This was an indentation error introduced in 2844aa6a
2022-11-30 19:17:08 +00:00