#17 importlib.find_module removed in Python 3.12, libray now errors on launch

닫힘
kerobaros8 달 전을 오픈 · 4개의 코멘트
kerobaros 코멘트됨, 8 달 전

I had libray installed inside an Ubuntu container using Python 3.10.2, and it worked perfectly. However, after installing libray with pip on my Fedora system with Python 3.12.2:

Traceback (most recent call last):
  File "/home/kerobaros/.local/bin/libray", line 27, in <module>
    from libray import core
  File "/home/kerobaros/.local/share/pipx/venvs/libray/lib/python3.12/site-packages/libray/__init__.py", line 31, in <module>
    _module = loader.find_module(module_name).load_module(module_name)
              ^^^^^^^^^^^^^^^^^^
AttributeError: 'FileFinder' object has no attribute 'find_module'

It appears that find_module was removed from importlib in Python 3.12. Here is a link to the 3.12 whatsnew discussing the removal. I believe the replacement for find_module is now importlib's find_spec.

I'm three sheets to the wind or else I'd start hacking on this myself. Please let me know if I can be of any assistance in the future.

I had libray installed inside an Ubuntu container using Python 3.10.2, and it worked perfectly. However, after installing libray with pip on my Fedora system with Python 3.12.2: ``` Traceback (most recent call last): File "/home/kerobaros/.local/bin/libray", line 27, in <module> from libray import core File "/home/kerobaros/.local/share/pipx/venvs/libray/lib/python3.12/site-packages/libray/__init__.py", line 31, in <module> _module = loader.find_module(module_name).load_module(module_name) ^^^^^^^^^^^^^^^^^^ AttributeError: 'FileFinder' object has no attribute 'find_module' ``` It appears that find_module was removed from importlib in Python 3.12. [Here is a link to the 3.12 whatsnew discussing the removal.](https://docs.python.org/3/whatsnew/3.12.html#importlib) I believe the replacement for find_module is now importlib's [find_spec](https://docs.python.org/3/library/importlib.html#importlib.machinery.FileFinder.find_spec). I'm three sheets to the wind or else I'd start hacking on this myself. Please let me know if I can be of any assistance in the future.
Nichlas Severinsen 코멘트됨, 8 달 전
소유자

Thank you very much for reporting, Archlinux is still on Python 3.11.7 so it's impressive that Fedora is on 3.12.2.

I'll see if I can fix it with a try/except.

I'm three sheets to the wind

Bahahah! Have a good one mate!

Tbh, I'm kind of thinking about moving away from Python if they are just going to break stuff repeatedly. This is like the 10th time something breaks for me because they're not ensuring backwards compatibility in new versions. It's a repeat of the whole Python2 vs Python3 ordeal, as if they didn't learn anything.

Thank you very much for reporting, Archlinux is still on Python 3.11.7 so it's impressive that Fedora is on 3.12.2. I'll see if I can fix it with a try/except. > I'm three sheets to the wind Bahahah! Have a good one mate! Tbh, I'm kind of thinking about moving away from Python if they are just going to break stuff repeatedly. This is like the 10th time something breaks for me because they're not ensuring backwards compatibility in new versions. It's a repeat of the whole Python2 vs Python3 ordeal, as if they didn't learn anything.
Nichlas Severinsen 커밋 8 달 전에서 이 이슈 언급
Nichlas Severinsen 커밋 8 달 전에서 이 이슈 언급
Nichlas Severinsen 코멘트됨, 8 달 전
소유자

Hmm, okay I hope it works now. Feel free to test:

pipx install git+https://notabug.org/necklace/libray
Hmm, okay I hope it works now. Feel free to test: ``` pipx install git+https://notabug.org/necklace/libray ```
kerobaros 코멘트됨, 8 달 전
포스터

Works On My System (tm). Or at least it launches, I haven't tried to decrypt anything yet. Thanks for the quick turnaround!

Works On My System (tm). Or at least it launches, I haven't tried to decrypt anything yet. Thanks for the quick turnaround!
Nichlas Severinsen 커밋 8 달 전에서 이 이슈 언급
Nichlas Severinsen 코멘트됨, 8 달 전
소유자

Of course, if you install that way you won't have any bundled keys. I recommend installing the PyPI version.

Either way, released 0.0.10 to fix this and a couple other issues, as well as more keys bundled and better game detection.

Of course, if you install that way you won't have any bundled keys. I recommend installing the PyPI version. Either way, released 0.0.10 to fix this and a couple other issues, as well as more keys bundled and better game detection.
로그인하여 이 대화에 참여
마일스톤 없음
담당자 없음
참여자 2명
로딩중...
취소
저장
아직 콘텐츠가 없습니다.