Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash - AttributeError: 'str' object has no attribute 'open' #79

Open
TheFrenchGhosty opened this issue Apr 8, 2023 · 4 comments
Open

Comments

@TheFrenchGhosty
Copy link

TheFrenchGhosty commented Apr 8, 2023

Itchio-dl crashed while downloading, I tried restarting it, but it happened again

It crashes on multiples files, so it doesn't seems related to something specific about a file.

Running the release (2.3)

Downloading Air Dasher - Dasher_1_03_003.apk
Downloaded Dasher_1_03_003.apk
Downloading Dasher_1_03_003.zip
File Already Exists! Dasher_1_03_003.zip
MD5 Mismatch! Dasher_1_03_003.zip
Moving Dasher_1_03_003.zip to old/
Downloading Air Dasher - Dasher_1_03_003.zip
Downloaded Dasher_1_03_003.zip
Downloaded Air Dasher (4 of <REDACTED>)
Traceback (most recent call last):
  File "/config/.local/bin/itch-download", line 8, in <module>
    sys.exit(main())
  File "/config/.local/lib/python3.10/site-packages/itchiodl/downloader/__main__.py", line 62, in main
    lib.download_library(args.platform)
  File "/config/.local/lib/python3.10/site-packages/itchiodl/library.py", line 108, in download_library
    for _ in r:
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 621, in result_iterator
    yield _result_or_cancel(fs.pop())
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 319, in _result_or_cancel
    return fut.result(timeout)
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/.local/lib/python3.10/site-packages/itchiodl/library.py", line 99, in dl
    g.download(self.login, platform)
  File "/config/.local/lib/python3.10/site-packages/itchiodl/game.py", line 75, in download
    self.do_download(d, token)
  File "/config/.local/lib/python3.10/site-packages/itchiodl/game.py", line 110, in do_download
    md5 = utils.md5sum(str(out_file))
  File "/config/.local/lib/python3.10/site-packages/itchiodl/utils.py", line 51, in md5sum
    with path.open("rb") as f:
AttributeError: 'str' object has no attribute 'open'
@Emersont1
Copy link
Owner

This should be fixed in main, and will be pushed out with the next release

@TheFrenchGhosty
Copy link
Author

@Emersont1 Tested, it now crashes with:

Downloaded [MOOD] Pixel Art Font Set (33 of <REDACTED>)
Traceback (most recent call last):
  File "/config/.local/bin/itch-download", line 8, in <module>
    sys.exit(main())
  File "/config/.local/lib/python3.10/site-packages/itchiodl/downloader/__main__.py", line 62, in main
    lib.download_library(args.platform)
  File "/config/.local/lib/python3.10/site-packages/itchiodl/library.py", line 108, in download_library
    for _ in r:
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 621, in result_iterator
    yield _result_or_cancel(fs.pop())
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 319, in _result_or_cancel
    return fut.result(timeout)
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/.local/lib/python3.10/site-packages/itchiodl/library.py", line 99, in dl
    g.download(self.login, platform)
  File "/config/.local/lib/python3.10/site-packages/itchiodl/game.py", line 75, in download
    self.do_download(d, token)
  File "/config/.local/lib/python3.10/site-packages/itchiodl/game.py", line 187, in do_download
    if utils.md5sum(out_file) != d["md5_hash"]:
KeyError: 'md5_hash'

@triple-j
Copy link
Contributor

PR #80 addresses the KeyError: 'md5_hash' issue.

@TheFrenchGhosty
Copy link
Author

TheFrenchGhosty commented May 14, 2023

@triple-j Your patch seems to indeed work perfectly, thanks, I now hit #86

Traceback (most recent call last):
  File "/config/.local/bin/itch-download", line 8, in <module>
    sys.exit(main())
  File "/config/.local/lib/python3.10/site-packages/itchiodl/downloader/__main__.py", line 78, in main
    lib.download_library(args.platform)
  File "/config/.local/lib/python3.10/site-packages/itchiodl/library.py", line 107, in download_library
    for _ in r:
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 621, in result_iterator
    yield _result_or_cancel(fs.pop())
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 319, in _result_or_cancel
    return fut.result(timeout)
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/.local/lib/python3.10/site-packages/itchiodl/library.py", line 98, in dl
    g.download(self.login, platform)
  File "/config/.local/lib/python3.10/site-packages/itchiodl/game.py", line 99, in download
    self.do_download(d, token)
  File "/config/.local/lib/python3.10/site-packages/itchiodl/game.py", line 232, in do_download
    if utils.md5sum(out_file) != d["md5_hash"]:
  File "/config/.local/lib/python3.10/site-packages/itchiodl/utils.py", line 54, in md5sum
    with path.open("rb") as f:
  File "/usr/lib/python3.10/pathlib.py", line 1119, in open
    return self._accessor.open(self, mode, buffering, encoding, errors,
FileNotFoundError: [Errno 2] No such file or directory: 'darkjaguar8/a-fairys-day-adventure/A Fairy’s Day Adventure into the Human World.pdf'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants