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-129354: Use PyErr_FormatUnraisable() function #129656

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Feb 4, 2025

Replace PyErr_WriteUnraisable() with PyErr_FormatUnraisable().

Replace PyErr_WriteUnraisable() with PyErr_FormatUnraisable().
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does repr always work at that stage of finalization?

@vstinner
Copy link
Member Author

vstinner commented Feb 4, 2025

Does repr always work at that stage of finalization?

I hope so. Before this change, repr() was already used. It's not something new. Only the error message is changed.

@vstinner vstinner merged commit 14489c1 into python:main Feb 4, 2025
45 checks passed
@vstinner vstinner deleted the format_unraisable8 branch February 4, 2025 15:21
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM64 macOS 3.x has failed when building commit 14489c1.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/725/builds/9664) and take a look at the build logs.
  4. Check if the failure is related to this commit (14489c1) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/725/builds/9664

Failed tests:

  • test.test_multiprocessing_spawn.test_processes

Failed subtests:

  • test_repr_rlock - test.test_multiprocessing_spawn.test_processes.WithProcessesTestLock.test_repr_rlock
  • test_preauth_data_to_tls_server - test.test_ssl.TestPreHandshakeClose.test_preauth_data_to_tls_server

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/_test_multiprocessing.py", line 1530, in test_repr_rlock
    self.assertEqual('<RLock(SomeOtherThread, nonzero)>', repr(lock))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '<RLock(SomeOtherThread, nonzero)>' != '<RLock(None, 0)>'
- <RLock(SomeOtherThread, nonzero)>
+ <RLock(None, 0)>


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.x.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_ssl.py", line 5094, in test_preauth_data_to_tls_server
    self.assertIn("before TLS handshake with data", wrap_error.args[1])
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'before TLS handshake with data' not found in '[SSL: RECORD_LAYER_FAILURE] record layer failure (_ssl.c:1066)'

srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Feb 7, 2025
Replace PyErr_WriteUnraisable() with PyErr_FormatUnraisable().
cmaloney pushed a commit to cmaloney/cpython that referenced this pull request Feb 8, 2025
Replace PyErr_WriteUnraisable() with PyErr_FormatUnraisable().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants