sammko/picomc

Curse modpack from a local file seems to be broken

Zajozor opened this issue · 2 comments

disclaimer: Not urgent/important, i managed to get what i wanted to work eventually.

I believe that using picomc mod pack curse install with a path to a local file (instead of a url) might be broken.
(inserting a curse url works fine).

Link to the zip: https://github.com/thecodingchicken/Jimmys-Jams-omni-releases/raw/main/Omnifactory-dev-e3e6711-snapshot.zip

MultiMC can import the zip without a problem and I checked the contents so I believe the zip is fine.

Output:

➜  ~ picomc mod pack curse install Omnifactory-dev-e3e6711-snapshot.zip
Traceback (most recent call last):
  File "/usr/local/anaconda3/bin/picomc", line 8, in <module>
    sys.exit(main())
  File "/usr/local/anaconda3/lib/python3.7/site-packages/picomc/main.py", line 8, in main
    picomc_cli(obj=es)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/anaconda3/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/anaconda3/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  [Previous line repeated 1 more time]
  File "/usr/local/anaconda3/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/picomc/cli/utils.py", line 16, in wrapper
    fn(x, *a, **kwa)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/picomc/mod/curse.py", line 239, in install_cli
    install_from_path(path, launcher, im, name)
  File "/usr/local/anaconda3/lib/python3.7/site-packages/picomc/mod/curse.py", line 205, in install_from_path
    with open(zipfile, "rb") as fd:
TypeError: expected str, bytes or os.PathLike object, not ZipFile

The zip file in question actually exposes two separate problems.
The trivial bug from the stack trace is fixed in 4ebf392. But even after this, the zip file does not install, because its structure does not match that of usual curse zips -- the files are not located in the root of the archive, but instead in a subdirectory. I will have a look at this.

Now also fixed in 6a5e8d1.