apocalyptech / bl3-cli-saveedit

Commandline Borderlands 3 Savefile/Profile Editor
zlib License
106 stars 20 forks source link

Python error when trying to parse inventory contents #29

Open hihanhoesj opened 2 weeks ago

hihanhoesj commented 2 weeks ago

Hi,

First off, thank you for the project.

Not sure if this is just me, but I am getting the following error when I try to list the inventory contents

Traceback (most recent call last):
  File "/home/ianc/BL3-saveeditor-venv/bin/bl3-profile-info", line 8, in <module>
    sys.exit(main())
  File "/home/ianc/BL3-saveeditor-venv/lib/python3.9/site-packages/bl3save/cli_prof_info.py", line 94, in main
    if item.eng_name:
  File "/home/ianc/BL3-saveeditor-venv/lib/python3.9/site-packages/bl3save/datalib.py", line 525, in eng_name
    self._parse_serial()
  File "/home/ianc/BL3-saveeditor-venv/lib/python3.9/site-packages/bl3save/datalib.py", line 326, in _parse_serial
    if self._version > self.serial_db.max_version:
  File "/home/ianc/BL3-saveeditor-venv/lib/python3.9/site-packages/bl3save/datalib.py", line 789, in max_version
    self._initialize()
  File "/home/ianc/BL3-saveeditor-venv/lib/python3.9/site-packages/bl3save/datalib.py", line 772, in _initialize
    with lzma.open(io.BytesIO(importlib.resources.files(__name__).joinpath(
  File "/home/ianc/.pyenv/versions/3.9.20/lib/python3.9/importlib/resources.py", line 147, in files
    return _common.from_package(_get_package(package))
  File "/home/ianc/.pyenv/versions/3.9.20/lib/python3.9/importlib/resources.py", line 51, in _get_package
    raise TypeError('{!r} is not a package'.format(package))
TypeError: 'bl3save.datalib' is not a package

I am running on Debian 12 and have tried running in Python 3.9, 3.10 and the native 3.11. Same error in all of them.

Error is reported in both the profile and save info modules.

Error can also be triggered when you try and save with -o items

Any assistance will be appreciated.

apocalyptech commented 2 weeks ago

Hm, interesting. I assume it's something to do with how it's been installed; the issue isn't necessarily the inventory parsing so much as it can't find that datalib library for some reason. I admit I've never actually used pyenv for anything; I wonder if it has something to do with that? I'll try to give that a try in a bit to see if I can reproduce it.

hihanhoesj commented 2 weeks ago

Appreciate you looking into it. The pyenv was me downgrading my python to the non-system python3.11 of Debian 12.

I installed bl3-cli-saveedit using venv

$ python -m venv BL3-saveeditor-venv
$ . BL3-saveeditor-venv/bin/activate
(BL3-saveeditor-venv) $ pip install bl3-cli-saveedit

I have just tried installing the package as a system package, but no luck. Same error.

apocalyptech commented 2 weeks ago

Oh shoot, y'know, I actually wasn't testing it properly before; hadn't actually gotten into the item-parsing code. Yeah, I'm sure it's a bug added with the most recent release. I'll try to get it sorted out this weekend. Sorry for the bother!