Skip to content

command hardcode-tray returns an error : local variable 'data' referenced before assignment #777

@ijash

Description

@ijash

Specifications

  • Hardcode-Tray version : HardcodeTray 4.3
  • Distribution : Linux Mint 21.3 Cinnamon
  • Desktop environment: cinnamon 6.0.4
  • Gtk version : GTK 3.24.33

Expected behavior and actual behavior

Expected:
run without error
Actual:
returns an error

Steps to reproduce the problem

  1. execute:
sudo -E hardcode-tray --conversion-tool RSVGConvert --size 16 --theme Papirus
  1. do the 1- apply
ijash@lm-wp:~$ sudo -E hardcode-tray --conversion-tool RSVGConvert --size 16 --theme Papirus
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: Cinnamon
Scaling Factor: 1
Icon Size: 16
Icon Theme: Papirus
Conversion Tool: RSVGConvert
To Do: All
1 - Apply
2 - Revert
3 - Clear Backup Cache
Please choose: 1
Applying now…
  1. error:
Traceback (most recent call last):
  File "/usr/bin/hardcode-tray", line 123, in <module>
    App.execute()
  File "/usr/lib/python3/dist-packages/HardcodeTray/app.py", line 100, in execute
    apps = App.get_supported_apps()
  File "/usr/lib/python3/dist-packages/HardcodeTray/app.py", line 90, in get_supported_apps
    application_data = Parser(db_file)
  File "/usr/lib/python3/dist-packages/HardcodeTray/modules/parser.py", line 47, in __init__
    self._read()
  File "/usr/lib/python3/dist-packages/HardcodeTray/modules/parser.py", line 91, in _read
    self._parse_paths(data["app_path"], "app_path")
UnboundLocalError: local variable 'data' referenced before assignment
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_bin_hardcode-tray.0.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/hardcode-tray", line 123, in <module>
    App.execute()
  File "/usr/lib/python3/dist-packages/HardcodeTray/app.py", line 100, in execute
    apps = App.get_supported_apps()
  File "/usr/lib/python3/dist-packages/HardcodeTray/app.py", line 90, in get_supported_apps
    application_data = Parser(db_file)
  File "/usr/lib/python3/dist-packages/HardcodeTray/modules/parser.py", line 47, in __init__
    self._read()
  File "/usr/lib/python3/dist-packages/HardcodeTray/modules/parser.py", line 91, in _read
    self._parse_paths(data["app_path"], "app_path")
UnboundLocalError: local variable 'data' referenced before assignment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions