Crashes when saving preferences when download subfolder is invalid

Bug #1411841 reported by Luke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rapid Photo Downloader
Status tracked in Pyqt
Pyqt
Fix Released
Medium
Damon Lynch

Bug Description

To reproduce, set the Video (didn't try Photo) download subfolder to "/" in the preferences dialog and click close.

Traceback (most recent call last):
  File "/usr/share/rapid-photo-downloader/rapid/preferencesdialog.py", line 1634, in on_preferencesdialog_response
    self.check_subfolder_values_valid_on_exit(self.prefs.video_subfolder, self._update_video_subfolder_pref_on_error, _("video"), "video_subfolder")
  File "/usr/share/rapid-photo-downloader/rapid/preferencesdialog.py", line 1620, in check_subfolder_values_valid_on_exit
    sys.stderr.write(msg + "\n")
NameError: global name 'sys' is not defined

I fixed by importing sys and tried again:

The video subfolder preferences entered are invalid and cannot be used.
They will be reset to their default values.
Traceback (most recent call last):
  File "/usr/share/rapid-photo-downloader/rapid/preferencesdialog.py", line 1634, in on_preferencesdialog_response
    self.check_subfolder_values_valid_on_exit(self.prefs.video_subfolder, self._update_video_subfolder_pref_on_error, _("video"), "video_subfolder")
  File "/usr/share/rapid-photo-downloader/rapid/preferencesdialog.py", line 1621, in check_subfolder_values_valid_on_exit
    misc.run_dialog(PROGRAM_NAME, msg)
NameError: global name 'PROGRAM_NAME' is not defined

I fixed by copying line 117 PROGRAM_NAME = _('Rapid Photo Downloader') from rapid/rapid.py and tried again:

[CRITICAL/MainProcess] Program preferences are invalid
[ERROR/MainProcess] Error in Video Download Subfolders preferences
[ERROR/MainProcess] Sorry, these preferences contain an error:
[ERROR/MainProcess] /

[ERROR/MainProcess] Subfolder preferences should not start with a /.
Resetting to default values.
Traceback (most recent call last):
  File "/usr/share/rapid-photo-downloader/rapid/rapid.py", line 2245, in on_preferences_action_activate
    preferencesdialog.PreferencesDialog(self)
  File "/usr/share/rapid-photo-downloader/rapid/preferencesdialog.py", line 906, in __init__
    self._setup_video_download_folder_tab()
  File "/usr/share/rapid-photo-downloader/rapid/preferencesdialog.py", line 1206, in _setup_video_download_folder_tab
    self._setup_video_subfolder_table()
  File "/usr/share/rapid-photo-downloader/rapid/preferencesdialog.py", line 1170, in _setup_video_subfolder_table
    self.video_subfolder_table = VideoSubfolderTable(self, None)
  File "/usr/share/rapid-photo-downloader/rapid/preferencesdialog.py", line 686, in __init__
    PhotoRenameTable.__init__(self, preferencesdialog, adjust_scroll_window)
  File "/usr/share/rapid-photo-downloader/rapid/preferencesdialog.py", line 511, in __init__
    gtk.MESSAGE_ERROR)
  File "/usr/share/rapid-photo-downloader/rapid/misc.py", line 41, in run_dialog
    d.set_transient_for(parent.get_toplevel())
  File "/usr/share/rapid-photo-downloader/rapid/preferencesdialog.py", line 944, in __getattr__
    raise AttributeError(key)
AttributeError: get_toplevel

Revision history for this message
Damon Lynch (dlynch3) wrote :

Thanks for reporting the bug. It's probably been there for some years now!

Changed in rapid:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Damon Lynch (dlynch3)
Revision history for this message
Damon Lynch (dlynch3) wrote :

I'm marking the bug as "fixed released" because the latest release does not use this code any longer.

Changed in rapid:
milestone: none → 0.9.0a1
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.