Skip to content

importlib.util.find_spec raises attribute error on python 3.11 containers #12

Description

@tauheedali

Hi!
This issue was initially found while using the proman-versioning package in our pipeline. After some investigation, it appears the lines

if importlib.util.find_spec('xmltodict'):  # type: ignore
    from compendium.filetypes.xml import XmlConfig

are causing an error since importlib.util probably because is a frozen module on the docker containers where we are running this.

Steps to reproduce
docker run -it --rm python:3.11-alpine python -c "import importlib; importlib.util"
docker run -it --rm python:3.11 python -c "import importlib; importlib.util"
docker run -it --rm python:3.11-slim python -c "import importlib; importlib.util"
docker run -it --rm python:3.11-slim-bullseye python -c "import importlib; importlib.util"

using importlib.util directly resolves the issue

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions