CommunityDragon / CDTB

A library containing everything to extract files from client files.
GNU Lesser General Public License v3.0
119 stars 33 forks source link

FileNotFound when doing download #39

Closed ghost closed 4 years ago

ghost commented 4 years ago

This is the first command listed in README under example. I have not changed anything in hand. It's just freshly cloned. FreeBSD 12.1 stable, Python 3.8.2.

$ python3 -m cdragontoolbox -v download -s patcher:cdn patch=
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/dikoyezhivotnoye/CDTB/cdragontoolbox/__main__.py", line 493, in <module>
    main()
  File "/Users/dikoyezhivotnoye/CDTB/cdragontoolbox/__main__.py", line 489, in main
    globals()[f"command_{args.command.replace('-', '_')}"](parser, args)
  File "/Users/dikoyezhivotnoye/CDTB/cdragontoolbox/__main__.py", line 81, in command_download
    for component in parse_component_args(parser, args.storage, args.component):
  File "/Users/dikoyezhivotnoye/CDTB/cdragontoolbox/__main__.py", line 47, in parse_component_args
    return [e for c in components for e in parse_component_arg(parser, storage, c)]
  File "/Users/dikoyezhivotnoye/CDTB/cdragontoolbox/__main__.py", line 47, in <listcomp>
    return [e for c in components for e in parse_component_arg(parser, storage, c)]
  File "/Users/dikoyezhivotnoye/CDTB/cdragontoolbox/__main__.py", line 35, in parse_component_arg
    component = parse_storage_component(storage, component)
  File "/Users/dikoyezhivotnoye/CDTB/cdragontoolbox/storage.py", line 476, in parse_storage_component
    patch = storage.patch(version)
  File "/Users/dikoyezhivotnoye/CDTB/cdragontoolbox/storage.py", line 318, in patch
    return next(it)
  File "/Users/dikoyezhivotnoye/CDTB/cdragontoolbox/storage.py", line 302, in patches
    for _, group in itertools.groupby(self.patch_elements(stored=stored), key=lambda e: e.version):
  File "/Users/dikoyezhivotnoye/CDTB/cdragontoolbox/patcher.py", line 346, in patch_elements
    for release in self.iter_releases():
  File "/Users/dikoyezhivotnoye/CDTB/cdragontoolbox/patcher.py", line 339, in iter_releases
    yield PatcherRelease(self, version)
  File "/Users/dikoyezhivotnoye/CDTB/cdragontoolbox/patcher.py", line 470, in __init__
    with open(self.storage.fspath(f"{self.storage_dir}/release.json")) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'cdn/cdn/cdtb/releases/live/1599329299/release.json'

There is a:

4       cdn/cdtb/releases/live/latest.timestamp
4       cdn/cdtb/releases/live/1599329299/release.json

I am not sure why it is looking for cdn/cdn instead of cdn/.

benoitryder commented 4 years ago

Thanks for the report. This was a bug which should now be fixed. Don't hesitate to reopen if it still fails.