diff options
author | Petr Viktorin <encukou@gmail.com> | 2025-01-10 12:59:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-10 12:59:51 (GMT) |
commit | 802556abfa008abe0bdd78e6f9e18bef71db90c1 (patch) | |
tree | c7a2f1405b1bb5f62603cb3b53c361ef5965cf7e /Misc | |
parent | 688f3a0d4b94874ff6d72af3baafd8bbf911153e (diff) | |
download | cpython-802556abfa008abe0bdd78e6f9e18bef71db90c1.zip cpython-802556abfa008abe0bdd78e6f9e18bef71db90c1.tar.gz cpython-802556abfa008abe0bdd78e6f9e18bef71db90c1.tar.bz2 |
gh-127257: Add hex code to ssl "unknown error" message (GH-127360)
* ssl: Add hex error code to "unknown error" messages
To make it easier to vary the individual parts of the message,
replace the if-ladder with constant format strings by building
the string piece-wise with PyUnicodeWriter.
Use "unknown error (0x%x)" rather than just "unknown error" if we
can't get a better error message. (Hex makes sense as the error
includes two packed parts.)
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Library/2024-11-28-14-24-12.gh-issue-127360.HVKt-c.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2024-11-28-14-24-12.gh-issue-127360.HVKt-c.rst b/Misc/NEWS.d/next/Library/2024-11-28-14-24-12.gh-issue-127360.HVKt-c.rst new file mode 100644 index 0000000..4772aef --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-11-28-14-24-12.gh-issue-127360.HVKt-c.rst @@ -0,0 +1,4 @@ +When a descriptive error message cannot be provided for an +:exc:`ssl.SSLError`, the "unknown error" message now shows the internal +error code (as retrieved by ``ERR_get_error`` and similar OpenSSL +functions). |