Repository navigation
Commit 0405f10
gh-159811: Raise OpenSSL errors in `_hashlib.HASH` after re-attaching the thread state (GH-159817)
When `EVP_DigestUpdate()` failed, `_hashlib_HASH_hash()` raised a Python
exception, however, `_hashlib.HASH.update()` and the `_hashlib.HASH`
constructor release the GIL before calling it when the data is larger
than `HASHLIB_GIL_MINSIZE` bytes.
`_hashlib_HASH_hash()` now only returns an error status and its callers
raise the exception once they have re-attached the thread state.
(cherry picked from commit 6fa2d64)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent 6db7cb9 commit 0405f10
2 files changed
Lines changed: 15 additions & 3 deletions
File tree
- Misc/NEWS.d/next/Library
- Modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
846 | 846 | | |
847 | 847 | | |
848 | 848 | | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
849 | 855 | | |
850 | 856 | | |
851 | 857 | | |
| |||
857 | 863 | | |
858 | 864 | | |
859 | 865 | | |
860 | | - | |
861 | 866 | | |
862 | 867 | | |
863 | 868 | | |
| |||
990 | 995 | | |
991 | 996 | | |
992 | 997 | | |
993 | | - | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
994 | 1003 | | |
995 | 1004 | | |
996 | 1005 | | |
| |||
1304 | 1313 | | |
1305 | 1314 | | |
1306 | 1315 | | |
1307 | | - | |
| 1316 | + | |
1308 | 1317 | | |
1309 | 1318 | | |
1310 | 1319 | | |
| |||
0 commit comments