OlavStornes / ModBuddy

Mod buddy is a mod manager created with extensibility in mind
GNU General Public License v3.0
35 stars 3 forks source link

Error on first start #7

Closed frostworx closed 3 years ago

frostworx commented 3 years ago

Hi, I know you're going to polish it anyways, but it might be good to know that the program doesn't even start here. (Arch Linux with Python 3.9.2, pyqt5-5.15.3-2, pyqt5-sip-12.8.1-3 - both pyqt5 components are installed via package management, not via pip)

On an initial launch I get this error:

$ LC_ALL=C ./main.py
Traceback (most recent call last):
  File "/tmp/ModBuddy/./main.py", line 290, in <module>
    window = Ui()
  File "/tmp/ModBuddy/./main.py", line 47, in __init__
    self.update_game_combobox()
  File "/tmp/ModBuddy/./main.py", line 80, in update_game_combobox
    for x in GAME_PRESET_FOLDER.iterdir():
  File "/usr/lib/python3.9/pathlib.py", line 1149, in iterdir
    for name in self._accessor.listdir(self):
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ModBuddy/games'

When I create the missing games directory manually this one:

$ LC_ALL=C ./main.py
Traceback (most recent call last):
  File "/tmp/ModBuddy/./main.py", line 290, in <module>
    window = Ui()
  File "/tmp/ModBuddy/./main.py", line 50, in __init__
    self.update_fileview()
  File "/tmp/ModBuddy/./main.py", line 133, in update_fileview
    path = str(Path(mod_path).parent)
  File "/usr/lib/python3.9/pathlib.py", line 1071, in __new__
    self = cls._from_parts(args, init=False)
  File "/usr/lib/python3.9/pathlib.py", line 696, in _from_parts
    drv, root, parts = self._parse_args(args)
  File "/usr/lib/python3.9/pathlib.py", line 680, in _parse_args
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Did I forget something obvious? If you need anything else for a proper bug report please let me know.

OlavStornes commented 3 years ago

Hi, and thanks for a detailed error message!

The only one forgetting something obvious is me in this case. First one is a blunder on my part, assuming that python can use non-existent folders. The second error is probably a pathing issue, either when python parses 'current' directories in the path (the dot in your path /tmp/ModBuddy/./main.py or a bug when starting fresh.

I'll look into fixing these errors in a few hours.

frostworx commented 3 years ago

Thank you for the friendly support! Very appreciated! :)

OlavStornes commented 3 years ago

As expected, it was a stupid easy fix. As i could easily replicate it on my own, i closed this before waiting for a confirmation.

frostworx commented 3 years ago

Thanks! Even stupid easy fixes can be important :)