Skip to content

gh-126742: allow to use non-UTF8 exception messages #126746

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

Merged
merged 47 commits into from
Dec 17, 2024

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Nov 12, 2024

@picnixz picnixz changed the title gh-126742: allow to use translated exception messages gh-126742: allow to use non-UTF8 exception messages Nov 12, 2024
@ZeroIntensity
Copy link
Member

Technically, since this is a bugfix, let's wait until #126555 has landed before we merge this, and then address all the uses of dlerror() in this PR.

@picnixz
Copy link
Member Author

picnixz commented Nov 12, 2024

then address all the uses of dlerror() in this PR.

I actually thought of doing it two PRs. Technically, this specific PR can be merged without waiting for the other and then you can use this interface in the other (rather the other way around).

@ZeroIntensity
Copy link
Member

Eh, I would rather not. Let's not overwhelm someone with thread states and the private API on their first PR :)

@ZeroIntensity ZeroIntensity removed needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes DO-NOT-MERGE labels Nov 13, 2024
@ZeroIntensity
Copy link
Member

I've removed backport labels, per what Petr said in the issue. I think he's right--let's just focus on main with this.

@encukou
Copy link
Member

encukou commented Nov 15, 2024

Hmm, just had an idea: if we add a “char* in locale encoding” format to PyUnicode_FromFormat, it'll be possible to use it with PyErr_Format -- but also for non-error messages.

@ZeroIntensity
Copy link
Member

I like that idea! But we're exposing this as a public API--how often might users need this? (I've never needed to mess with locale in any of my C API usage, but to be fair I'm typically not calling APIs that return strings.)

@picnixz
Copy link
Member Author

picnixz commented Nov 15, 2024

Hmm, just had an idea: if we add a “char* in locale encoding” format to

I'm not very fond of adding a case to additionally check when there's not a lot of use cases (unless proven otherwise). It shouldn't affect performances much (but this needs verification) but this would complicate an already complicate function I think (and people need to remember this new format as well).

@ZeroIntensity
Copy link
Member

No no, I don't think he meant a variation of PyUnicode_FromFormat that takes a locale, he meant a format value %whatever that automatically calls PyUnicode_DecodeLocale or something like that.

@picnixz
Copy link
Member Author

picnixz commented Nov 15, 2024

No no, I don't think he meant a variation of PyUnicode_FromFormat that takes a locale, he meant a format value %whatever that automatically calls PyUnicode_DecodeLocale or something like that.

And I understood. I don't think a new code should be added unless there is a real need.

@ZeroIntensity
Copy link
Member

And I understood.

Ah! I couldn't tell, sorry.

A code search for PyUnicode_DecodeLocale is showing not too much real world usage--maybe that's a bad thing? Depending on how common it is for a non-UTF8 locale to break things, maybe it would be a good idea to add a format character just so people start handling it.

@encukou
Copy link
Member

encukou commented Nov 19, 2024

It could also show that we're mainly handling errors from the OS at one point -- the OSError constructor. That would be a good thing :)

Anyway, for this PR: @picnixz, do you want to add calls to the new helper(s)?

@ZeroIntensity
Copy link
Member

FWIW, Bénédikt is on vacation right now. I don't think he'll be able to implement anything until next week.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

I don't see the purpose of these internal functions since they are now used. This PR only adds dead code. I would prefer to see how these functions are used.

If only dlerror() uses it, why not using code using dlerror()?

@encukou encukou marked this pull request as draft November 20, 2024 09:46
@miss-islington-app
Copy link

Thanks @picnixz for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @picnixz and @encukou, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 7303f06846b69016a075bca7ad7c6055f29ad024 3.12

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 17, 2024
…r messages (pythonGH-126746)

- Add a helper to set an error from locale-encoded `char*`
- Use the helper for gdbm & dlerror messages
(cherry picked from commit 7303f06)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app
Copy link

bedevere-app bot commented Dec 17, 2024

GH-128023 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Dec 17, 2024
@serhiy-storchaka
Copy link
Member

This is a bug fix. It should be backported.

@picnixz
Copy link
Member Author

picnixz commented Dec 17, 2024

Ah! I think we should also have a NEWS entry. I'll add one. Sorry for forgetting about it :(

@picnixz
Copy link
Member Author

picnixz commented Dec 17, 2024

Concerning the failure on 3.12 backport it's because we did not backported the PR on dlerror() usages yet. I've opened a PR for that #127764

@picnixz picnixz deleted the fix/locale-set-object-exception-126742 branch December 17, 2024 11:44
serhiy-storchaka pushed a commit that referenced this pull request Dec 17, 2024
…or messages (GH-126746) (GH-128023)

- Add a helper to set an error from locale-encoded `char*`
- Use the helper for gdbm & dlerror messages
(cherry picked from commit 7303f06)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
@picnixz picnixz added needs backport to 3.12 only security fixes and removed needs backport to 3.12 only security fixes labels Dec 17, 2024
@miss-islington-app
Copy link

Thanks @picnixz for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @picnixz and @encukou, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 7303f06846b69016a075bca7ad7c6055f29ad024 3.12

@picnixz
Copy link
Member Author

picnixz commented Dec 17, 2024

Grrr. I thought that the conflicts would be easily solved but apparently not. I'll do the backport manually.

picnixz added a commit to picnixz/cpython that referenced this pull request Dec 17, 2024
…r messages (pythonGH-126746)

- Add a helper to set an error from locale-encoded `char*`
- Use the helper for gdbm & dlerror messages

Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app
Copy link

bedevere-app bot commented Dec 17, 2024

GH-128027 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Dec 17, 2024
serhiy-storchaka pushed a commit that referenced this pull request Dec 17, 2024
…or messages (GH-126746) (GH-128027)

- Add a helper to set an error from locale-encoded `char*`
- Use the helper for gdbm & dlerror messages

Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-bot
Copy link

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

Hi! The buildbot PPC64LE RHEL8 3.x has failed when building commit 7303f06.

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/559/builds/5438) and take a look at the build logs.
  4. Check if the failure is related to this commit (7303f06) 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/559/builds/5438

Failed tests:

  • test_ctypes

Failed subtests:

  • test_localized_error_in_dll - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_in_dll
  • test_localized_error_from_dll - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_from_dll
  • test_localized_error_dlsym - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_dlsym

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le/build/Lib/test/test_ctypes/test_dlerror.py", line 179, in test_localized_error_dlsym
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le/build/Lib/test/test_ctypes/test_dlerror.py", line 144, in test_localized_error_from_dll
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le/build/Lib/test/test_ctypes/test_dlerror.py", line 153, in test_localized_error_in_dll
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'

@picnixz
Copy link
Member Author

picnixz commented Dec 17, 2024

Ok, so I didn't expect that on some archs, the error message would be different...

@bedevere-bot
Copy link

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

Hi! The buildbot PPC64LE RHEL8 LTO 3.x has failed when building commit 7303f06.

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/361/builds/5642) and take a look at the build logs.
  4. Check if the failure is related to this commit (7303f06) 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/361/builds/5642

Failed tests:

  • test_ctypes

Failed subtests:

  • test_localized_error_in_dll - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_in_dll
  • test_localized_error_from_dll - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_from_dll
  • test_localized_error_dlsym - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_dlsym

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto/build/Lib/test/test_ctypes/test_dlerror.py", line 179, in test_localized_error_dlsym
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto/build/Lib/test/test_ctypes/test_dlerror.py", line 153, in test_localized_error_in_dll
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto/build/Lib/test/test_ctypes/test_dlerror.py", line 144, in test_localized_error_from_dll
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'

@vstinner
Copy link
Member

Tests are failing on PPC64LE RHEL8 LTO 3.x:

AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'

@picnixz
Copy link
Member Author

picnixz commented Dec 17, 2024

I've opened #128034 for this but Serhiy suggested removing the filename check as well.

@bedevere-bot
Copy link

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

Hi! The buildbot PPC64LE RHEL8 3.13 has failed when building commit fe08cdf.

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/1430/builds/360) and take a look at the build logs.
  4. Check if the failure is related to this commit (fe08cdf) 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/1430/builds/360

Failed tests:

  • test_ctypes

Failed subtests:

  • test_localized_error_in_dll - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_in_dll
  • test_localized_error_from_dll - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_from_dll
  • test_localized_error_dlsym - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_dlsym

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le/build/Lib/test/test_ctypes/test_dlerror.py", line 153, in test_localized_error_in_dll
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le/build/Lib/test/test_ctypes/test_dlerror.py", line 144, in test_localized_error_from_dll
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le/build/Lib/test/test_ctypes/test_dlerror.py", line 179, in test_localized_error_dlsym
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'

@bedevere-bot
Copy link

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

Hi! The buildbot PPC64LE RHEL8 LTO + PGO 3.13 has failed when building commit fe08cdf.

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/1444/builds/374) and take a look at the build logs.
  4. Check if the failure is related to this commit (fe08cdf) 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/1444/builds/374

Failed tests:

  • test_ctypes

Failed subtests:

  • test_localized_error_in_dll - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_in_dll
  • test_localized_error_from_dll - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_from_dll
  • test_localized_error_dlsym - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_dlsym

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/test/test_ctypes/test_dlerror.py", line 153, in test_localized_error_in_dll
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/test/test_ctypes/test_dlerror.py", line 179, in test_localized_error_dlsym
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/test/test_ctypes/test_dlerror.py", line 144, in test_localized_error_from_dll
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'

@bedevere-bot
Copy link

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

Hi! The buildbot PPC64LE RHEL8 LTO 3.13 has failed when building commit fe08cdf.

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/1412/builds/375) and take a look at the build logs.
  4. Check if the failure is related to this commit (fe08cdf) 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/1412/builds/375

Failed tests:

  • test_ctypes

Failed subtests:

  • test_localized_error_in_dll - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_in_dll
  • test_localized_error_from_dll - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_from_dll
  • test_localized_error_dlsym - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_dlsym

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.lto/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.lto/build/Lib/test/test_ctypes/test_dlerror.py", line 153, in test_localized_error_in_dll
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.lto/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.lto/build/Lib/test/test_ctypes/test_dlerror.py", line 144, in test_localized_error_from_dll
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.lto/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.lto/build/Lib/test/test_ctypes/test_dlerror.py", line 179, in test_localized_error_dlsym
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'

@bedevere-bot
Copy link

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

Hi! The buildbot PPC64LE RHEL8 Refleaks 3.13 has failed when building commit fe08cdf.

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/1407/builds/317) and take a look at the build logs.
  4. Check if the failure is related to this commit (fe08cdf) 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/1407/builds/317

Failed tests:

  • test_ctypes

Failed subtests:

  • test_localized_error_in_dll - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_in_dll
  • test_localized_error_from_dll - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_from_dll
  • test_localized_error_dlsym - test.test_ctypes.test_dlerror.TestLocalization.test_localized_error_dlsym

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.refleak/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.refleak/build/Lib/test/test_ctypes/test_dlerror.py", line 153, in test_localized_error_in_dll
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.refleak/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.refleak/build/Lib/test/test_ctypes/test_dlerror.py", line 144, in test_localized_error_from_dll
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.refleak/build/Lib/contextlib.py", line 85, in inner
    return func(*args, **kwds)
  File "/home/buildbot/buildarea/3.13.cstratak-RHEL8-ppc64le.refleak/build/Lib/test/test_ctypes/test_dlerror.py", line 179, in test_localized_error_dlsym
    self.assertIn(self.libc_filename, str(cm.exception))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'libc.so.6' not found in '/lib64/glibc-hwcaps/power9/libc-2.28.so: undefined symbol: this_name_does_not_exist'

srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
…r messages (pythonGH-126746)

- Add a helper to set an error from locale-encoded `char*`
- Use the helper for gdbm & dlerror messages

Co-authored-by: Victor Stinner <vstinner@python.org>
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.

6 participants