gh-94808: Cover %p in PyUnicode_FromFormat#96677
Conversation
|
And we got a failure: MacOS passes locally and on CI, but other platforms do not. Windows: Ubuntu: I think it is better to remove |
Sorry, something went wrong.
kumaraditya303
left a comment
There was a problem hiding this comment.
I think a regex test would be better here.
Sorry, something went wrong.
|
Good idea, thank you. |
Sorry, something went wrong.
|
From https://github.com/python/cpython/actions/runs/3200613350/jobs/5227726848 This is quite interesting. Is |
Sorry, something went wrong.
|
Interesting! I think that comes from libc since I can't find code in CPython that would do this. |
Sorry, something went wrong.
|
From https://pubs.opengroup.org/onlinepubs/009695399/functions/fprintf.html
I think it is better to just leave Related discussions: |
Sorry, something went wrong.
|
I think ctypes translates None into NULL, which is reasonable. |
Sorry, something went wrong.
|
Thanks @sobolevn for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Sorry, something went wrong.
|
Sorry @sobolevn and @JelleZijlstra, I had trouble checking out the |
Sorry, something went wrong.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> (cherry picked from commit 72c166a) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
Thanks @sobolevn for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> (cherry picked from commit 72c166a) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot s390x SLES 3.x has failed when building commit 72c166a. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/540/builds/3747 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Tests result: FAILURE then FAILURE == 420 tests OK. 10 slowest tests:
1 test failed: 16 tests skipped: 1 re-run test: Total duration: 5 min 53 sec Click to see traceback logsTraceback (most recent call last):
File "/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_unicode.py", line 2817, in test_from_format
self.assertRegex(p_format1, p_format_regex)
AssertionError: Regex didn't match: '^0x[a-zA-Z0-9]{8,}$' not found in '0x153b8c0'
|
Sorry, something went wrong.
|
I guess the pointers are shorter on s390. I'll adjust the regex. |
Sorry, something went wrong.
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot AMD64 FreeBSD Non-Debug 3.x has failed when building commit 72c166a. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/172/builds/2913 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Tests result: FAILURE then FAILURE == 415 tests OK. 10 slowest tests:
1 test failed: 21 tests skipped: 1 re-run test: Total duration: 17 min Click to see traceback logsTraceback (most recent call last):
File "/usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build/Lib/test/test_unicode.py", line 2817, in test_from_format
self.assertRegex(p_format1, p_format_regex)
AssertionError: Regex didn't match: '^0x[a-zA-Z0-9]{8,}$' not found in '0x612bd0'
|
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot x86 Gentoo Installed with X 3.x has failed when building commit 72c166a. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/464/builds/3172 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Tests result: FAILURE then FAILURE == 417 tests OK. 1 test failed: 17 tests skipped: 1 re-run test: Total duration: 53 min 22 sec Click to see traceback logsTraceback (most recent call last):
File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_unicode.py", line 2817, in test_from_format
self.assertRegex(p_format1, p_format_regex)
AssertionError: Regex didn't match: '^0x[a-zA-Z0-9]{8,}$' not found in '0x8bd9f0'
Traceback (most recent call last):
File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.12/test/test_unicode.py", line 2817, in test_from_format
self.assertRegex(p_format1, p_format_regex)
AssertionError: Regex didn't match: '^0x[a-zA-Z0-9]{8,}$' not found in '0x9809f0'
|
Sorry, something went wrong.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Source:
cpython/Objects/unicodeobject.c
Lines 2531 to 2552 in 4f523a7
Internet says that some systems can return representation with
0x, some with0X, and some with none. It is reflected in the implementation, but cannot be reflected in tests.