appimagelint icon indicating copy to clipboard operation
appimagelint copied to clipboard

appimagelint should not die if it can't open the icon its testing

Open stuaxo opened this issue 5 years ago • 4 comments

Tested with fiddlereverywhere https://www.telerik.com/download/fiddler-everywhere

appimagelint.icons_check[80690] [INFO] [✔] Valid icon in AppDir root
appimagelint.icons_check[80690] [INFO] Checking resolution of icon: /tmp/.mount_fiddleGMyyLA/.DirIcon
Traceback (most recent call last):
  File "/home/stu/.local/bin/appimagelint", line 33, in <module>
    sys.exit(load_entry_point('appimagelint', 'console_scripts', 'appimagelint')())
  File "/home/stu/src/appimagelint/appimagelint/cli.py", line 142, in run
    for testres in check.run():
  File "/home/stu/src/appimagelint/appimagelint/checks/icons.py", line 106, in run
    dotdiricon_valid = self._check_icon_for_valid_resolution(op.join(mountpoint, ".DirIcon"))
  File "/home/stu/src/appimagelint/appimagelint/checks/icons.py", line 279, in _check_icon_for_valid_resolution
    res = self._get_icon_res(icon_path)
  File "/home/stu/src/appimagelint/appimagelint/checks/icons.py", line 245, in _get_icon_res
    is_svg = self._is_svg(icon_path)
  File "/home/stu/src/appimagelint/appimagelint/checks/icons.py", line 222, in _is_svg
    with open(icon_path) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/.mount_fiddleGMyyLA/.DirIcon'

stuaxo avatar Sep 24 '20 10:09 stuaxo

A .DirIcon is mandatory so it is correct that the test fails when the file is missing. However a nicer way to communicate the test failure would indeed be nice :-)

probonopd avatar Sep 24 '20 17:09 probonopd

+1, the test should fail, but it's probably a normal enough booboo that it can fail in a nice non stacktracey way.

stuaxo avatar Sep 24 '20 18:09 stuaxo

I agree but I think @TheAssassin said once that this is the way in which the test fails.

probonopd avatar Sep 26 '20 17:09 probonopd

Well, a friendly error message is probably better. PRs welcome.

TheAssassin avatar Sep 26 '20 17:09 TheAssassin