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

Franz 5.5 is broken #637

Closed
skoruppa opened this issue May 22, 2020 · 7 comments
Closed

Franz 5.5 is broken #637

skoruppa opened this issue May 22, 2020 · 7 comments

Comments

@skoruppa
Copy link

Specifications

  • Hardcode-Tray version : 4.3
  • Distribution : Ubuntu 18.04
  • Application name : Franz
  • Application version : 5.5

Expected behavior and actual behavior

Applying the script with the newest Franz installed ends with errors. I have added print(_(app_name)) to see what app causes the issue.

sudo -E hardcode-tray --conversion-tool RSVGConvert --size 22 --theme Suru++ --apply 

Welcome to Hardcode-Tray!
Hardcode-Tray replaces some icons on the binary files of some applications. 
Please close all the running applications before running Hardcode-Tray script.
Desktop Environment: Other
Scaling Factor: 1
Icon Size: 22
Icon Theme: Suru++
Conversion Tool: RSVGConvert
To Do: All
Applying now..


Chromium
Chromium            [###.................................] 1/11 9.1% 0.13s
Discord
Discord             [#######.............................] 2/11 18.2% 0.09s
Franz
Traceback (most recent call last):
  File "/usr/bin/hardcode-tray", line 121, in <module>
    App.execute()
  File "/usr/lib/python3.6/site-packages/HardcodeTray/app.py", line 121, in execute
    delta = app.do_action(action)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/application.py", line 148, in do_action
    self.install()
  File "/usr/lib/python3.6/site-packages/HardcodeTray/decorators.py", line 58, in wrapper
    func(app)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/application.py", line 96, in install
    self.execute(Action.APPLY)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/helpers/binary.py", line 50, in execute
    self.install_icon(icon, icon_path)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/electron.py", line 41, in install_icon
    self.set_icon(icon, icon_path, png_bytes, True)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/electron.py", line 66, in set_icon
    asar.write(icon_to_replace, png_bytes)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/helpers/asar.py", line 106, in write
    new_files = change_dict_vals(self._header, sizediff, offset0)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 245, in change_dict_vals
    if d2.get('offset') and int(d2.get('offset')) > offset:
TypeError: int() argument must be a string, a bytes-like object or a number, not 'dict'

Steps to reproduce the problem

  1. Install the newest Franz
  2. Execute hardcode-tray and apply icons
@bilelmoussaoui
Copy link
Owner

Duplicate of #553

@bilelmoussaoui bilelmoussaoui marked this as a duplicate of #553 May 22, 2020
@skoruppa
Copy link
Author

skoruppa commented May 22, 2020

@bilelmoussaoui I don't think this is related. Franz was patched for me without any issues until the last update. In #553 there is no mention of script crashing when trying to patch Franz. Additionally, I have changes from pull #585

@varlesh
Copy link
Collaborator

varlesh commented May 22, 2020

maybe it's happened because not detect Desktop Environment: Other
i check it, franz 5.5 compability icon path with 5.1

@skoruppa
Copy link
Author

But they updated electron to 8.1.1 ( meetfranz/franz@5b00c90 ). Maybe it is related?

Forcing Desktop Environment with DESKTOP_SESSION=gnome does not help

sudo DESKTOP_SESSION=gnome -E hardcode-tray --conversion-tool RSVGConvert --size 22 --theme Suru++ --apply 

Welcome to Hardcode-Tray!
Hardcode-Tray replaces some icons on the binary files of some applications. 
Please close all the running applications before running Hardcode-Tray script.
Desktop Environment: Gnome
Scaling Factor: 1
Icon Size: 22
Icon Theme: Suru++
Conversion Tool: RSVGConvert
To Do: All
Applying now..


Chromium
Chromium            [###.................................] 1/11 9.1% 0.16s
Discord
Discord             [#######.............................] 2/11 18.2% 0.10s
Discord
Franz
Traceback (most recent call last):
  File "/usr/bin/hardcode-tray", line 121, in <module>
    App.execute()
  File "/usr/lib/python3.6/site-packages/HardcodeTray/app.py", line 121, in execute
    delta = app.do_action(action)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/application.py", line 148, in do_action
    self.install()
  File "/usr/lib/python3.6/site-packages/HardcodeTray/decorators.py", line 58, in wrapper
    func(app)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/application.py", line 96, in install
    self.execute(Action.APPLY)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/helpers/binary.py", line 50, in execute
    self.install_icon(icon, icon_path)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/electron.py", line 41, in install_icon
    self.set_icon(icon, icon_path, png_bytes, True)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/electron.py", line 66, in set_icon
    asar.write(icon_to_replace, png_bytes)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/helpers/asar.py", line 106, in write
    new_files = change_dict_vals(self._header, sizediff, offset0)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 245, in change_dict_vals
    if d2.get('offset') and int(d2.get('offset')) > offset:
TypeError: int() argument must be a string, a bytes-like object or a number, not 'dict'

@varlesh
Copy link
Collaborator

varlesh commented May 22, 2020

confirm this :

sudo -E hardcode-tray -ct RSVGConvert
[sudo] пароль для alex: 
Добро пожаловать в Hardcode-Tray!
Hardcode-Tray replaces some icons on the binary files of some applications. 
Please close all the running applications before running Hardcode-Tray script.
Рабочее окружение: Kde
Увеличение: 1
Размер значков: 22
Тема значков: Papirus-Dark
Средство конвертирования: RSVGConvert
Цель:Всё
1 - Исправить
2 - Восстановить
3 - Очистить резервный кэш
Выберите:1
Исправление...


Dropbox             [####................................] 1/8 12.5% 0.07s
Traceback (most recent call last):
  File "/usr/bin/hardcode-tray", line 121, in <module>
    App.execute()
  File "/usr/lib/python3.6/site-packages/HardcodeTray/app.py", line 120, in execute
    delta = app.do_action(action)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/application.py", line 148, in do_action
    self.install()
  File "/usr/lib/python3.6/site-packages/HardcodeTray/decorators.py", line 58, in wrapper
    func(app)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/application.py", line 96, in install
    self.execute(Action.APPLY)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/helpers/binary.py", line 50, in execute
    self.install_icon(icon, icon_path)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/electron.py", line 41, in install_icon
    self.set_icon(icon, icon_path, png_bytes, True)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/electron.py", line 66, in set_icon
    asar.write(icon_to_replace, png_bytes)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/helpers/asar.py", line 106, in write
    new_files = change_dict_vals(self._header, sizediff, offset0)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 245, in change_dict_vals
    if d2.get('offset') and int(d2.get('offset')) > offset:
TypeError: int() argument must be a string, a bytes-like object or a number, not 'dict'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 145, in apport_excepthook
    os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o640), 'wb') as f:
FileNotFoundError: [Errno 2] Нет такого файла или каталога: '/var/crash/_usr_bin_hardcode-tray.0.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/hardcode-tray", line 121, in <module>
    App.execute()
  File "/usr/lib/python3.6/site-packages/HardcodeTray/app.py", line 120, in execute
    delta = app.do_action(action)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/application.py", line 148, in do_action
    self.install()
  File "/usr/lib/python3.6/site-packages/HardcodeTray/decorators.py", line 58, in wrapper
    func(app)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/application.py", line 96, in install
    self.execute(Action.APPLY)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/helpers/binary.py", line 50, in execute
    self.install_icon(icon, icon_path)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/electron.py", line 41, in install_icon
    self.set_icon(icon, icon_path, png_bytes, True)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/electron.py", line 66, in set_icon
    asar.write(icon_to_replace, png_bytes)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/modules/applications/helpers/asar.py", line 106, in write
    new_files = change_dict_vals(self._header, sizediff, offset0)
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in change_dict_vals
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 244, in <dictcomp>
    d2 = {k: change_dict_vals(v, sizediff, offset) for k, v in d.items()}
  File "/usr/lib/python3.6/site-packages/HardcodeTray/utils.py", line 245, in change_dict_vals
    if d2.get('offset') and int(d2.get('offset')) > offset:
TypeError: int() argument must be a string, a bytes-like object or a number, not 'dict'

@varlesh
Copy link
Collaborator

varlesh commented Feb 16, 2021

Gitify & Franz removed from database, because crashed Hardcode-Tray.

@acarasimon96
Copy link
Contributor

Fixed via #711 and e12bf91 🎉

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

No branches or pull requests

4 participants