mickael9 / fac

Command-line mod manager for Factorio (install, update...)
MIT License
50 stars 17 forks source link

Make compatible does not work #20

Open nihaals opened 6 years ago

nihaals commented 6 years ago

For example:

C:\Users\User>fac install UPS-up -i
Installing: UPS-up 0.2.2...
Downloading: UPS-up_0.2.2.zip... 100 %

C:\Users\User>fac make-compatible UPS-up
Unpacking: C:\Users\User\AppData\Roaming\Factorio\mods\UPS-up_0.2.2.zip
Removing file: C:\Users\User\AppData\Roaming\Factorio\mods\UPS-up_0.2.2.zip
Game version changed to 0.16 for UPS-up 0.2.2.
Traceback (most recent call last):
  File "c:\python\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python\Scripts\fac.exe\__main__.py", line 9, in <module>
  File "c:\python\lib\site-packages\fac\main.py", line 88, in main
    args.run(args)
  File "c:\python\lib\site-packages\fac\commands\make_compatible.py", line 39, in run
    mod.info.save()
  File "c:\python\lib\site-packages\fac\files.py", line 252, in save
    json.dump(self.data, f, indent=4)
  File "c:\python\lib\json\__init__.py", line 179, in dump
    for chunk in iterable:
  File "c:\python\lib\json\encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "c:\python\lib\json\encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "c:\python\lib\json\encoder.py", line 438, in _iterencode
    o = _default(o)
  File "c:\python\lib\json\encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type Version is not JSON serializable

and the contents of C:\Users\User\AppData\Roaming\Factorio\mods\UPS-up_0.2.2\info.json:

{
    "name": "UPS-up",
    "version": "0.2.2",
    "factorio_version": 

It's strange that it doesn't even have the closing bracket, and this is happening with all my incompatible mods.