Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-126554: correct detection ofgcc forTestNullDlsym.test_null_dlsym#129872
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ghost commentedFeb 8, 2025 • edited by ghost
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by ghost
Uh oh!
There was an error while loading.Please reload this page.
Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
picnixz commentedFeb 9, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Wait, how come the
cc@encukou (I don't remember why we didn't catch this) |
petermarko commentedFeb 9, 2025
The trace is actually from 3.12.9, but the subprocess call throws exception also in 3.13 and 3.14-rc although I didn't try to run the testsuite in those. I'll rewrite this to catch just |
gcc forTestNullDlsym.test_null_dlsym88e485a to4835b2bComparepetermarko commentedFeb 9, 2025
Beautified by adding Meanwhile I retested also 3.13.2, so I guess it's valid for all releases. |
picnixz commentedFeb 9, 2025
Ok, actually thereis a way to make it work without a try-except: We need to pass the >>>subprocess.call(["gcc","--version"],stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)0>>>subprocess.call(["gcc","--version"],stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL,shell=True)1 So, we need to be a bit more careful with the actual return code! So, instead I either indeed suggest using a subprocess.call(["which","abc"],stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)# == 1subprocess.call(["which","gcc"],stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)# == 0 So, let's use the guard. |
Uh oh!
There was an error while loading.Please reload this page.
In case gcc is not available, it will throw exception and test fails.So catch the exception to skip the test correctly.======================================================================ERROR: test_null_dlsym (test.test_ctypes.test_dlerror.TestNullDlsym.test_null_dlsym)----------------------------------------------------------------------Traceback (most recent call last): File "/usr/lib/python3.12/test/test_ctypes/test_dlerror.py", line 61, in test_null_dlsym retcode = subprocess.call(["gcc", "--version"], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/subprocess.py", line 391, in call with Popen(*popenargs, **kwargs) as p: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/subprocess.py", line 1028, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.12/subprocess.py", line 1963, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename)FileNotFoundError: [Errno 2] No such file or directory: 'gcc'Signed-off-by: Peter Marko <peter.marko@siemens.com>
4835b2b to2777a08CompareUh oh!
There was an error while loading.Please reload this page.
encukou commentedFeb 10, 2025
There is Perhaps it's time to add a test helper to find gcc/clang, and skip test if it's not available. (But that would be for a new PR.) |
978211c intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@petermarko for the PR, and@encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
…ull_dlsym` (pythonGH-129872)In case gcc is not available, the test will fail with FileNotFoundError.So catch the exception to skip the test correctly.(cherry picked from commit978211c)Co-authored-by: Peter Marko <peter.marko@siemens.com>Signed-off-by: Peter Marko <peter.marko@siemens.com>
GH-129944 is a backport of this pull request to the3.13 branch. |
encukou commentedFeb 10, 2025
Thank you for the report & fix,@petermarko! |
…ull_dlsym` (pythonGH-129872)In case gcc is not available, the test will fail with FileNotFoundError.So catch the exception to skip the test correctly.(cherry picked from commit978211c)Co-authored-by: Peter Marko <peter.marko@siemens.com>Signed-off-by: Peter Marko <peter.marko@siemens.com>
GH-129945 is a backport of this pull request to the3.12 branch. |
…null_dlsym` (GH-129872) (#129945)gh-126554: correct detection of `gcc` for `TestNullDlsym.test_null_dlsym` (GH-129872)In case gcc is not available, the test will fail with FileNotFoundError.So catch the exception to skip the test correctly.(cherry picked from commit978211c)Signed-off-by: Peter Marko <peter.marko@siemens.com>Co-authored-by: Peter Marko <peter.marko@siemens.com>
…null_dlsym` (GH-129872) (#129944)gh-126554: correct detection of `gcc` for `TestNullDlsym.test_null_dlsym` (GH-129872)In case gcc is not available, the test will fail with FileNotFoundError.So catch the exception to skip the test correctly.(cherry picked from commit978211c)Signed-off-by: Peter Marko <peter.marko@siemens.com>Co-authored-by: Peter Marko <peter.marko@siemens.com>
bedevere-bot commentedFeb 10, 2025
|
Uh oh!
There was an error while loading.Please reload this page.
In case gcc is not available, it will throw exception and test fails. So catch the exception to skip the test correctly.