Commit graph

117265 commits

Author SHA1 Message Date
Miss Islington (bot)
a1034b5fd3
[3.12] gh-105375: Improve error handling in the sys extension module (GH-105611) (#105665)
In _PySys_AddXOptionWithError() and sys_add_xoption(),
bail on first error to prevent exceptions from possibly being
overwritten.
(cherry picked from commit 41cddc2e93)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-11 21:12:17 +00:00
Miss Islington (bot)
82ac2be6b3
[3.12] gh-105375: Improve error handling in _ctypes (GH-105593) (#105663)
Prevent repeated PyLong_FromVoidPtr() from possibly overwriting the
current exception.
(cherry picked from commit e8998e46a7)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-11 20:25:27 +00:00
Miss Islington (bot)
ed038953fc
[3.12] gh-105375: Improve error handling in PyUnicode_BuildEncodingMap() (GH-105491) (#105661)
Bail on first error to prevent exceptions from possibly being overwritten.
(cherry picked from commit 555be81026)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-11 20:01:18 +00:00
Miss Islington (bot)
db5022c16f
[3.12] gh-105375: Improve PyErr_WarnExplicit() error handling (GH-105610) (#105659)
Bail on first error to prevent exceptions from possibly being
overwritten.
(cherry picked from commit 567d6ae8e7)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-11 19:51:30 +00:00
Miss Islington (bot)
c14f6ea7e4
[3.12] gh-105375: Improve posix error handling (GH-105592) (#105598)
Fix a bug where an IndexError could end up being overwritten.
(cherry picked from commit f668f73bc8)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-11 21:33:30 +02:00
Miss Islington (bot)
071d559def
[3.12] Fix typo in configparser module docstring (GH-105652) (#105653)
Fix typo in configparser module docstring (GH-105652)

"zc.buildbot" -> "zc.buildout"
(cherry picked from commit 845e593c4e)

Co-authored-by: litlighilit <97860435+litlighilit@users.noreply.github.com>
2023-06-11 14:31:04 +00:00
Miss Islington (bot)
122a1a2629
[3.12] gh-105375: Improve error handling in the builtins extension module (GH-105585) (#105649)
(cherry picked from commit d4fa52934a)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-11 11:17:48 +00:00
Miss Islington (bot)
b4b5565e47
[3.12] gh-105375: Improve _decimal error handling (GH-105605) (#105647)
Fix a bug where an exception could end up being overwritten.
(cherry picked from commit c932f72849)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-11 10:55:18 +00:00
Miss Islington (bot)
36ecbc3570
[3.12] gh-105375: Harden _datetime initialisation (GH-105604) (#105645)
Improve error handling so init bails on the first exception.
(cherry picked from commit 16d49680b5)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-11 10:46:33 +00:00
Miss Islington (bot)
85a1a0983f
[3.12] gh-105375: Harden _ssl initialisation (GH-105599) (#105642)
Add proper error handling to prevent reference leaks and overwritten
exceptions.
(cherry picked from commit 01f4230460)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-11 10:26:52 +00:00
Miss Islington (bot)
d3c69ed366
[3.12] gh-105375: Improve array.array exception handling (GH-105594) (#105644)
Fix a bug where 'tp_richcompare' could end up overwriting an exception.
(cherry picked from commit 35cff545db)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-11 10:24:22 +00:00
Miss Islington (bot)
bf6e0e618a
[3.12] gh-99108: Mention HACL\* in the hashlib docs. (GH-105634) (#105635)
gh-99108: Mention HACL\* in the hashlib docs. (GH-105634)
(cherry picked from commit 3a314f7c3d)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-06-10 12:10:04 -07:00
Miss Islington (bot)
e2bbe62e00
[3.12] Cleanup and clarify our hashlib docs. (GH-105624) (#105632)
Cleanup and clarify our hashlib docs. (GH-105624)

Clarify and improve our hashlib docs. Now with 50% less mess!
(cherry picked from commit 0d1d6ab966)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-06-10 11:49:59 -07:00
Miss Islington (bot)
8c4cf96a06
[3.12] gh-105375: Improve error handling in zoneinfo module (GH-105586) (#105612)
Fix bugs where exceptions could end up being overwritten
because of deferred error handling.

(cherry picked from commit 33c92c4f15)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-09 23:22:10 +00:00
Miss Islington (bot)
4fbbf699c0
[3.12] gh-105375: Harden error handling in _testcapi/heaptype.c (GH-105608) (#105615)
Bail on first error in heapctypesubclasswithfinalizer_finalize()
(cherry picked from commit d636d7dfe7)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-09 23:21:42 +00:00
Miss Islington (bot)
5dae2b1a5d
[3.12] Docs: fix formatting in 2023-06-09-12-59-18 NEWS item (GH-105607) (#105614)
(cherry picked from commit 91441bf7cb)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-09 21:53:53 +00:00
Miss Islington (bot)
ae6e002f5a
[3.12] gh-105549: Tokenize separately NUMBER and NAME tokens and allow 0-prefixed literals (GH-105555) (#105602)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-06-09 21:40:07 +00:00
Miss Islington (bot)
411366ccdb
[3.12] gh-105375: Improve error handling in _elementtree (GH-105591) (#105600)
Fix bugs where exceptions could end up being overwritten.
(cherry picked from commit 00b599ab5a)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-09 21:15:24 +00:00
Erlend E. Aasland
e0087df65d
[3.12] gh-105375: Improve errnomodule error handling (#105590) (#105596)
(cherry picked from commit eede1d2f48)

Bail immediately if an exception is set, to prevent exceptions from
being overwritten.
2023-06-09 20:36:53 +00:00
Erlend E. Aasland
04b76ece7f
[3.12] gh-105375: Improve _pickle error handling (#105475) (#105584)
(cherry picked from commit 89aac6f6b7)

Error handling was deferred in some cases, which could potentially lead
to exceptions being overwritten.
2023-06-09 18:08:32 +00:00
Miss Islington (bot)
65404930bd
[3.12] gh-105375: Improve error handling in compiler_enter_scope() (GH-105494) (#105581)
(cherry picked from commit 6c832ddcf2)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-09 17:23:45 +00:00
Miss Islington (bot)
bc365da711
[3.12] gh-105557: Remove duplicate sqlite3 test method (GH-105558) (#105561)
test_func_return_too_large_int() was defined twice.
Keep only the redefined method, as that also checks the tracebacks.
(cherry picked from commit b8fa7bda4f)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-09 17:15:55 +00:00
Miss Islington (bot)
16b1cdc87c
[3.12] gh-105564: Don't include artificial newlines in the line attribute of tokens (GH-105565) (#105579)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-06-09 16:58:14 +00:00
Miss Islington (bot)
97d846dc2b
[3.12] Clarify the supported cases in the tokenize module (GH-105569) (#105573)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-06-09 16:00:42 +00:00
Miss Islington (bot)
7c298d2dc5
[3.12] Miscellaneous improvements to the typing docs (GH-105529) (#105567)
Miscellaneous improvements to the typing docs (GH-105529)

Mostly, these are changes so that we use shorter sentences and shorter paragraphs. In particular, I've tried to make the first sentence introducing each object in the typing API short and declarative.
(cherry picked from commit 8e755923c9)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-09 15:37:33 +00:00
Victor Stinner
d29e86bea3
[3.12] gh-102304: Fix Py_INCREF() for limited C API 3.9 (#105553)
* gh-102304: Fix Py_INCREF() for limited C API 3.9 (#105550)

When Python is built in debug mode (Py_REF_DEBUG macro), Py_INCREF()
and Py_DECREF() of the limited C API 3.9 (and older) now call
Py_IncRef() and Py_DecRef(), since _Py_IncRef() and _Py_DecRef() were
added to Python 3.10.

(cherry picked from commit 7ba0fd9f87)

* gh-102304: Remove Py_INCREF() doc change (#105552)

Py_INCREF() was made compatible again with Python 3.9 and older in
the limited API of Python debug mode.

(cherry picked from commit 58e4b69f69)
2023-06-09 10:32:46 +00:00
Miss Islington (bot)
2f4a2d6c1b
[3.12] gh-105332: [Enum] Fix unpickling flags in edge-cases (GH-105348) (GH-105520)
* revert enum pickling from by-name to by-value

(cherry picked from commit 4ff5690e59)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-06-08 18:01:51 -07:00
Miss Islington (bot)
68eeab7fdd
[3.12] CI: Configure macOS build as per updated devguide recommendations (GH-105533) (#105536)
(cherry picked from commit a5f23d4110)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-08 23:00:53 +00:00
Miss Islington (bot)
77c03a3b72
[3.12] gh-100227: Lock Around Modification of the Global Allocators State (gh-105516) (gh-105532)
The risk of a race with this state is relatively low, but we play it safe anyway. We do avoid using the lock in performance-sensitive cases where the risk of a race is very, very low.
(cherry picked from commit 68dfa49627)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-06-08 22:35:53 +00:00
Miss Islington (bot)
3eccd95f56
[3.12] gh-102832: IDLE - update stackviewer open (GH-105528) (#105534)
gh-102832: IDLE - update stackviewer open (GH-105528)

Use 'last_exc' instead of 'last_value' in 3.12/3.
(cherry picked from commit bb3454c1a7)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-06-08 22:29:24 +00:00
Miss Islington (bot)
f565fed548
[3.12] gh-102832: IDLE - remove use of deprecated sys.last_xyzs for stackviewer (GH-103339) (#105526)
gh-102832: IDLE - remove use of deprecated sys.last_xyzs for stackviewer (GH-103339)
(cherry picked from commit 3ee921d84f)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-06-08 21:57:33 +00:00
Eric Snow
b08ea9a561
[3.12] gh-100227: Lock Around Adding Global Audit Hooks (gh-105515) (gh-105525)
The risk of a race with this state is relatively low, but we play it safe anyway.
(cherry picked from commit e822a676f1)
2023-06-08 21:05:47 +00:00
Miss Islington (bot)
2ad2bd8b14
[3.12] gh-100227: Lock Around Use of the Global "atexit" State (gh-105514) (gh-105517)
The risk of a race with this state is relatively low, but we play it safe anyway.
(cherry picked from commit 7799c8e678)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-06-08 19:27:44 +00:00
Miss Islington (bot)
8698fa83f6
[3.12] gh-104310: Rename the New Function in importlib.util (gh-105255) (gh-105518)
The original name wasn't as clear as it could have been. This change includes the following:

* rename the function
* change the default value for "disable_check" to False
* add clues to the docstring that folks should probably not use the function

---------

(cherry picked from commit 34c63b86d3)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2023-06-08 19:00:04 +00:00
Miss Islington (bot)
1f90b2f57a
[3.12] test_types: Replace raw assert statements (GH-105500) (#105507)
(cherry picked from commit a8eb7372ee)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-06-08 15:19:11 +00:00
Miss Islington (bot)
3c5f0eadd8
[3.12] Further improve docs for typing.Annotated (GH-105498) (#105503)
Further improve docs for `typing.Annotated` (GH-105498)
(cherry picked from commit d213c2990f)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-08 15:12:35 +00:00
Miss Islington (bot)
2b6f475db8
[3.12] gh-105431: Remove unused stuff from test_typing.NewTypeTests (GH-105432) (#105489)
gh-105431: Remove unused stuff from `test_typing.NewTypeTests` (GH-105432)
(cherry picked from commit 9d35a71a76)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-06-08 06:57:21 +00:00
Barney Gale
ae25f1c8e5
[3.12] GH-104996: Defer joining of pathlib.PurePath() arguments. (GH-104999) (GH-105483)
Joining of arguments is moved to `_load_parts`, which is called when a
normalized path is needed.

(cherry picked from commit ffeaec7e60)
2023-06-08 00:25:45 +01:00
Miss Islington (bot)
4b2263e4bf
[3.12] gh-103171: Forward-port new tests for runtime-checkable protocols decorated with @final (GH-105473) (#105474)
Forward-port of the tests that were added to the 3.11 branch in GH-105445
(cherry picked from commit f5df347fcf)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-07 22:54:42 +00:00
Miss Islington (bot)
3d4a786b9b
[3.12] gh-105390: Add explicit type cast (GH-105466) (#105472) 2023-06-07 23:46:24 +01:00
Miss Islington (bot)
1e128779be
[3.12] gh-94673: Ensure subtypes are readied only once in math.trunc() (gh-105465) (gh-105471)
Fixes a typo in d2e2e53.
(cherry picked from commit 5394bf92aa)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2023-06-07 20:11:10 +00:00
Miss Islington (bot)
4eadfb1c1a
[3.12] gh-90015: Document that PEP-604 unions do not support forward references (GH-105366) (#105460)
gh-90015: Document that PEP-604 unions do not support forward references (GH-105366)
(cherry picked from commit fbdee000de)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-07 19:11:48 +01:00
Miss Islington (bot)
d3092573a8
[3.12] Fix grammar and improve clarity for an deprecation message. (GH-105457) (#105458) 2023-06-07 12:41:04 -05:00
Miss Islington (bot)
9a7c4a5f39
[3.12] typing: Improve documentation of generic classes and aliases (GH-105369) (#105453)
typing: Improve documentation of generic classes and aliases (GH-105369)
(cherry picked from commit d63a7c3694)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-07 15:04:14 +00:00
Miss Islington (bot)
d36aa244c8
[3.12] gh-105437: Improve tests of type params names for PEP 695 (GH-105438) (#105452)
(cherry picked from commit 76883af6bf)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-06-07 14:35:12 +00:00
Miss Islington (bot)
98ccc2de6b
[3.12] gh-105430: Remove typing._Immutable unused internal helper (GH-105434) (#105451)
gh-105430: Remove `typing._Immutable` unused internal helper (GH-105434)
(cherry picked from commit 18309ad94b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-06-07 14:30:39 +00:00
Miss Islington (bot)
241c36e1dc
[3.12] gh-97797: Improve documentation for typing.Annotated (GH-105365) (#105448)
gh-97797: Improve documentation for typing.Annotated (GH-105365)
(cherry picked from commit e26d296984)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-07 14:57:25 +01:00
Miss Islington (bot)
92ab560ef5
[3.12] Improve docs for typing.TypeAlias (GH-105372) (#105446)
Improve docs for `typing.TypeAlias` (GH-105372)
(cherry picked from commit c5ec51ec8f)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-07 14:45:54 +01:00
Miss Islington (bot)
117c153d9f
[3.12] gh-105435: Fix spurious NEWLINE token if file ends with comment without a newline (GH-105442) (#105444) 2023-06-07 14:07:57 +01:00
Miss Islington (bot)
bb6ea72003
[3.12] gh-105375: Improve error handling in sqlite3 collation callback (GH-105412) (#105440)
Check for error after each call to PyUnicode_FromStringAndSize().
(cherry picked from commit a24a780d93)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-07 11:43:18 +00:00