hbldh / pybankid

BankID Relying Party client for Python

Home Page:https://pybankid.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Version 1.1.0 throws importlib.resources has no attribute files

MikHol opened this issue · comments

  • pybankid version: 1.1.0
  • Python version: 3.8.x
  • Operating System: Ubuntu 18.04 LTS

Description

When upgrading to version 1.1.0 the error importlib.resources has no attribute files was being shown. When downgrading to version 1.0.0 it started working again.

It seems that importlib.resources.files was introduced in Python 3.9 so that is what is causing this issue. Is there a workaround?

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.

What I Did

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

This is the failing line in certutils.py line 22
path = importlib.resources.files("bankid.certs").joinpath(file)

Why are you still using Ubuntu 18.04? Standard support for it ended in May 2023.
Are you sure you aren't using Ubuntu 20.04 as Ubuntu 18.04 has even older Python version (3.6.x) while Ubuntu 20.04 has 3.8.x

NB You can safely use PyBankID 1.0.1

That is a very good question and it is down to lack of time to change all over the board. It is planned within the next month to migrate. We are running python 3.8 in a virtual environment.

For now we will use 1.0.1.

Thank you!

I wrongly assumed that few people used pybankid and that those that did had newer Pythons. I tried to reduce workload without knowing the userbase. Sorry.

@MikHol This should now be solved and is released in newly published version 1.2.0 on PyPI. Try it out and see if it solves your problem.

Thanks for the quick turnaround on this @hbldh. Works fine on Ubuntu 20.04 with Python 3.8.10

We're also looking at upgrading soon but we're not there yet.

I wrongly assumed that few people used pybankid and that those that did had newer Pythons. I tried to reduce workload without knowing the userbase. Sorry.

No need to apologise. But may I suggest starting a poll (available in the Discussion module if what I'm reading is correct) to see how many people are actually using PyBankID. Or can you get some stats from PyPI?

I can confirm that it is working for me. Thank you for your quick turnaround!

I have tried to ask for comments in issues and PRs, but requirements only turn up after the software stops working. People who use it doesn't really come to the Github repo site just to peruse and see what is happening, and I don't blame them; I don't for almost 99% of the libraries I use.

I do changes and when I do I try to make time for handling this kind of fallout. It is hard to predict and takes a long time to think out and prepare for every situation that might arise.

It is no apology or critisism or anything like that. Just an observation and a description of a method of handling. Glad that you are helped and thank you for reporting problems that arise from using new versions.