Spoons / rmm

An Open Source RimWorld mod package manager and sorting tool.
GNU General Public License v3.0
24 stars 7 forks source link

Doesn't run any commands due to xml error #5

Closed cypai closed 1 year ago

cypai commented 2 years ago

Description None of the commands work. Logs below:

cpai@archlinux-cpai ~/Games/Games-hdd/rwmm $ rmm config
Ignoring /hdd/cpai/Steam/steamapps/common/RimWorld/Mods/Harmony
Ignoring /hdd/cpai/Steam/steamapps/common/RimWorld/Mods/Place mods here.txt
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/cpai/.pyenv/versions/3.10.4/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/cpai/.pyenv/versions/3.10.4/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/home/cpai/.pyenv/versions/3.10.4/lib/python3.10/site-packages/rmm/mod.py", line 75, in create_from_path
    tree = ET.parse(path / "About/About.xml")
  File "/home/cpai/.pyenv/versions/3.10.4/lib/python3.10/xml/etree/ElementTree.py", line 1229, in parse
    tree.parse(source, parser)
  File "/home/cpai/.pyenv/versions/3.10.4/lib/python3.10/xml/etree/ElementTree.py", line 580, in parse
    self._root = parser._parse_whole(source)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 8, column 30
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/cpai/.pyenv/versions/3.10.4/bin/rmm", line 10, in <module>
    sys.exit(run())
  File "/home/cpai/.pyenv/versions/3.10.4/lib/python3.10/site-packages/rmm/cli.py", line 548, in run
    globals()[command](sys.argv, manager)
  File "/home/cpai/.pyenv/versions/3.10.4/lib/python3.10/site-packages/rmm/cli.py", line 96, in wrapper_func
    func(*args, **kwargs)
  File "/home/cpai/.pyenv/versions/3.10.4/lib/python3.10/site-packages/rmm/cli.py", line 329, in config
    data = manager.order_all_mods()
  File "/home/cpai/.pyenv/versions/3.10.4/lib/python3.10/site-packages/rmm/manager.py", line 174, in order_all_mods
    installed_mods = self.installed_mods()
  File "/home/cpai/.pyenv/versions/3.10.4/lib/python3.10/site-packages/rmm/manager.py", line 110, in installed_mods
    mods = ModFolder.read_dict(self.config.mod_path)
  File "/home/cpai/.pyenv/versions/3.10.4/lib/python3.10/site-packages/rmm/mod.py", line 183, in read_dict
    return Mod.list_to_dict(ModFolder.read(path))
  File "/home/cpai/.pyenv/versions/3.10.4/lib/python3.10/site-packages/rmm/mod.py", line 171, in read
    p.map(
  File "/home/cpai/.pyenv/versions/3.10.4/lib/python3.10/multiprocessing/pool.py", line 364, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/home/cpai/.pyenv/versions/3.10.4/lib/python3.10/multiprocessing/pool.py", line 771, in get
    raise self._value
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 8, column 30

Was installed via the AUR. Needed to manually install dependencies with pip due to use of pyenv instead of system Python.

All 3 environment variables were set to their respective directories, and the ModsConfig.xml was set to the default no mods version by RimWorld.

Reproduction Run any command, above was rmm list.

Info OS: Arch Linux RimWorld version: 1.3.3326 rev564

$ rmm -v
1.0.14.dev2
Spoons commented 1 year ago

That exception occurs when a mod's metadata file contains invalid XML. I'll publish a patch that will have rmm ignore mods with invalid metadata and release it by end of day so that rmm will be usable for you.

Do you have a list of what mods you have installed? I'd love to take a look at the file which is causing the issue.

Spoons commented 1 year ago

I've published the changes. I'm going to close this because the issue is fixed but I'm still interested in the additional information. 630a9dfee5ebbdf7920bb0105c494a68917ec0dd

With regards to the dependencies with pyenv, rmm has a Pipfile in the source code. It is the recommended way to manage dependencies in Python right now, afaik. Install pipenv in your pyenv and then use pipenv install