Closed
Description
For example, in the collation callback two str
objects (string1
and string2
) are created using PyUnicode_FromStringAndSize
. Error handling should happen directly after each call to PyUnicode_FromStringAndSize
:
cpython/Modules/_sqlite/connection.c
Lines 1870 to 1875 in 0cb6b9b
Other cases where error handling is not done immediately after the API has been used:
- gh-105375: Improve error handling in PyUnicode_BuildEncodingMap() #105491
- gh-105375: Improve error handling in compiler_enter_scope() #105494
- gh-105375: Improve error handling in the builtins extension module #105585
- gh-105375: Improve errnomodule error handling #105590
- gh-105375: Improve error handling in _elementtree #105591
- gh-105375: Improve posix error handling #105592
- gh-105375: Improve error handling in _ctypes #105593
- gh-105375: Improve array.array exception handling #105594
- gh-105375: Improve error handling in _Unpickler_SetInputStream() #105667
- gh-105375: Improve _pickle error handling #105475
- gh-105375: Harden _ssl initialisation #105599
- gh-105375: Improve error handling in
zoneinfo
module #105586 - gh-105375: Harden _datetime initialisation #105604
- gh-105375: Harden pyexpat initialisation #105606
- gh-105375: Improve _decimal error handling #105605
- gh-105375: Harden error handling in
_testcapi/heaptype.c
#105608 - gh-105375: Improve PyErr_WarnExplicit() error handling #105610
- gh-105375: Improve error handling in the sys extension module #105611
I might have missed some; I did not do a complete audit yet.
Linked PRs
- gh-105375: Improve error handling in sqlite3 collation callback #105412
- [3.12] gh-105375: Improve error handling in sqlite3 collation callback (GH-105412) #105440
- [3.11] gh-105375: Improve error handling in sqlite3 collation callback (GH-105412) #105441
- gh-105375: Improve _pickle error handling #105475
- gh-105375: Improve error handling in PyUnicode_BuildEncodingMap() #105491
- gh-105375: Improve error handling in compiler_enter_scope() #105494
- [3.12] gh-105375: Improve error handling in compiler_enter_scope() (GH-105494) #105581
- [3.11] gh-105375: Improve error handling in compiler_enter_scope() (#105494) #105582
- [3.11] gh-105375: Improve _pickle error handling (#105475) #105583
- [3.12] gh-105375: Improve _pickle error handling (#105475) #105584
- gh-105375: Improve error handling in the builtins extension module #105585
- gh-105375: Improve error handling in
zoneinfo
module #105586 - gh-105375: Improve errnomodule error handling #105590
- gh-105375: Improve error handling in _elementtree #105591
- gh-105375: Improve posix error handling #105592
- gh-105375: Improve error handling in _ctypes #105593
- gh-105375: Improve array.array exception handling #105594
- [3.12] gh-105375: Improve errnomodule error handling (#105590) #105596
- [3.11] gh-105375: Improve posix error handling (GH-105592) #105597
- [3.12] gh-105375: Improve posix error handling (GH-105592) #105598
- gh-105375: Harden _ssl initialisation #105599
- [3.12] gh-105375: Improve error handling in _elementtree (GH-105591) #105600
- [3.11] gh-105375: Improve error handling in _elementtree (GH-105591) #105601
- gh-105375: Harden _datetime initialisation #105604
- gh-105375: Improve _decimal error handling #105605
- gh-105375: Harden error handling in
_testcapi/heaptype.c
#105608 - gh-105375: Improve PyErr_WarnExplicit() error handling #105610
- gh-105375: Improve error handling in the sys extension module #105611
- [3.12] gh-105375: Improve error handling in
zoneinfo
module (GH-105586) #105612 - [3.11] gh-105375: Improve error handling in
zoneinfo
module (GH-105586) #105613 - [3.12] gh-105375: Harden error handling in
_testcapi/heaptype.c
(GH-105608) #105615 - [3.12] gh-105375: Harden _ssl initialisation (GH-105599) #105642
- [3.11] gh-105375: Improve array.array exception handling (GH-105594) #105643
- [3.12] gh-105375: Improve array.array exception handling (GH-105594) #105644
- [3.12] gh-105375: Harden _datetime initialisation (GH-105604) #105645
- [3.11] gh-105375: Harden _datetime initialisation (GH-105604) #105646
- [3.12] gh-105375: Improve _decimal error handling (GH-105605) #105647
- [3.11] gh-105375: Improve _decimal error handling (GH-105605) #105648
- [3.12] gh-105375: Improve error handling in the builtins extension module (GH-105585) #105649
- [3.11] gh-105375: Improve error handling in the builtins extension module (GH-105585) #105650
- [3.11] gh-105375: Harden _ssl initialisation (#105599) #105651
- [3.12] gh-105375: Improve PyErr_WarnExplicit() error handling (GH-105610) #105659
- [3.11] gh-105375: Improve PyErr_WarnExplicit() error handling (GH-105610) #105660
- [3.12] gh-105375: Improve error handling in PyUnicode_BuildEncodingMap() (GH-105491) #105661
- [3.11] gh-105375: Improve error handling in PyUnicode_BuildEncodingMap() (GH-105491) #105662
- [3.12] gh-105375: Improve error handling in _ctypes (GH-105593) #105663
- [3.11] gh-105375: Improve error handling in _ctypes (GH-105593) #105664
- [3.12] gh-105375: Improve error handling in the sys extension module (GH-105611) #105665
- [3.11] gh-105375: Improve error handling in the sys extension module (#105611) #105666
- gh-105375: Improve error handling in _Unpickler_SetInputStream() #105667
- [3.11] gh-105375: Harden pyexpat initialisation (#105606) #105668
- [3.12] gh-105375: Harden pyexpat initialisation (#105606) #105669
- gh-105375: Explicitly initialise all {Pickler,Unpickler}Object fields #105686
- [3.12] gh-105375: Explicitly initialise all {Pickler,Unpickler}Object fields (GH-105686) #105710
- [3.11] gh-105375: Explicitly initialise all {Pickler,Unpickler}Object fields (#105686) #105711
- [3.12] gh-105375: Improve error handling in _Unpickler_SetInputStream() (#105667) #105720
- [3.11] gh-105375: Improve error handling in _Unpickler_SetInputStream() (#105667) #105721