Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-127257: Add hex code to ssl "unknown error" message #127360

Merged
merged 2 commits into from
Jan 10, 2025

Conversation

encukou
Copy link
Member

@encukou encukou commented Nov 28, 2024

This does not fix #127257 but would have made it easier to debug.

  • To make it easier to vary the individual parts of the message,
    replace the if-ladder with a few constant format strings by
    building the string piece-wise using 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 byte-packed parts.)

As there are no cases where we should raise an "unknown error",
I don't see a good way to add tests. But, we can verify using the
current failure on Arch Linux buildbots.
Existing tests do cover 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.)
@encukou encukou requested a review from gpshead November 28, 2024 13:26
@encukou encukou changed the title gh-127257: Add hex code "unknown error" message gh-127257: Add hex code to ssl "unknown error" message Nov 28, 2024
@encukou
Copy link
Member Author

encukou commented Nov 28, 2024

!buildbot Arch.Linux

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @encukou for commit 87f1452 🤖

The command will test the builders whose names match following regular expression: Arch.Linux

The builders matched are:

  • AMD64 Arch Linux Perf PR
  • AMD64 Arch Linux Asan PR
  • AMD64 Arch Linux VintageParser PR
  • AMD64 Arch Linux Valgrind PR
  • AMD64 Arch Linux Usan PR
  • AMD64 Arch Linux Usan Function PR
  • AMD64 Arch Linux Asan Debug PR
  • AMD64 Arch Linux TraceRefs PR

@encukou encukou merged commit 802556a into python:main Jan 10, 2025
42 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir topic-SSL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[tests] test_poplib fails with "env changed" on Arch Linux with OpenSSL 3.4: [SYS] unknown error (_ssl.c:2634)
2 participants