Repository navigation
cukinia_python_pkg: Fix check for import module - #111
Merged
Merged
Conversation
Tests for cukinia_python_pkg failed in a toolbx container running Ubuntu 24.04 with Python 3.12. Two issues were found: 1. The condition to check for find_loader was never met, so find_spec was always used 2. In (at least) Python 3.12, 'import importlib' fails and 'import importlib.util' should be used (both of these work in 3.14) Issue 1 was probably masked by versions of Python supporting find_spec (3.4+), while Issue 2 was probably masked by versions of Python where 'import importlib' works as expected. Signed-off-by: Eduardo Ramirez <eramirez@data-modul.com>
kevlhop
approved these changes
Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: I found this due to this discussion, I was attempting to set up something closer to your CI in order to run future tests if needed and noticed that I introduced an issue in 48915f3. I'm not sure why it didn't fail in CI due to the wrong import (AFAIK my container has the same Ubuntu and Python version), but I decided to fix it anyway.
Commit message:
Tests for cukinia_python_pkg failed in a toolbx container running Ubuntu 24.04 with Python 3.12. Two issues were found:
Issue 1 was probably masked by versions of Python supporting find_spec (3.4+), while Issue 2 was probably masked by versions of Python where 'import importlib' works as expected.