! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Crash if you try to import a invalid configuration file
Status:
RESOLVED: FIXED
Product:
Xfce4-panel-profiles
Component:
General

Comments

Description ema-pe 2019-09-22 11:51:59 CEST
How to reproduce:

1. Open xfce4-panel-profiles;
2. Click 'Import' button;
3. Now the file chooser will be opened, select any invalid configuration file and click 'Open';
4. Now a dialog will ask you to specify a name for this configuration, click 'Save Configuration';
5. The UI will freeze.

Traceback:

Traceback (most recent call last):
  File "/usr/share/xfce4-panel-profiles/xfce4-panel-profiles/xfce4-panel-profiles.py", line 255, in on_import_clicked
    self._copy(filename, dst)
  File "/usr/share/xfce4-panel-profiles/xfce4-panel-profiles/xfce4-panel-profiles.py", line 93, in _copy
    PanelConfig.from_file(src).to_file(dst)
  File "/usr/share/xfce4-panel-profiles/xfce4-panel-profiles/panelconfig.py", line 76, in from_file
    pc.source = tarfile.open(filename, mode='r')
  File "/usr/lib64/python3.7/tarfile.py", line 1578, in open
    raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully

Proposed solution: add an alert dialog and go back to main window.

I'll try to fix this bug in the next days.
Comment 1 ema-pe 2019-09-22 12:54:50 CEST
Created attachment 9048 
Add error for invalid config (bug #15983)
Comment 2 Git Bot editbugs 2019-11-26 11:55:15 CET
Emanuele Petriglia referenced this bugreport in commit 7568fd10452ca27963cf72e1d1b9c74065e72e4f

Add error for invalid config (bug #15983)

https://git.xfce.org/apps/xfce4-panel-profiles/commit?id=7568fd10452ca27963cf72e1d1b9c74065e72e4f
Comment 3 Sean Davis editbugs 2019-11-26 11:55:38 CET
Thanks for the patch! Applied above.

Bug #15983

Reported by:
ema-pe
Reported on: 2019-09-22
Last modified on: 2019-11-26

People

Assignee:
Sean Davis
CC List:
2 users

Version

Version:
unspecified

Attachments

Additional information