Preferences cannot open because of a Folder chooser/copyto path related exception

Bug #1409622 reported by Peter Levi
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Variety
Fix Released
Critical
Peter Levi

Bug Description

I am unable to launch the preferences in Arch Linux. If I run Variety from the CLI I get this message.

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/variety/VarietyWindow.py", line 232, in on_mnu_preferences_activate
    self.create_preferences_dialog()
  File "/usr/lib/python2.7/site-packages/variety/VarietyWindow.py", line 206, in create_preferences_dialog
    self.preferences_dialog = PreferencesVarietyDialog(parent=self) # pylint: disable=E1102
  File "/usr/lib/python2.7/site-packages/variety_lib/PreferencesDialog.py", line 37, in __new__
    new_object.finish_initializing(builder, parent)
  File "/usr/lib/python2.7/site-packages/variety/PreferencesVarietyDialog.py", line 98, in finish_initializing
    self.reload()
  File "/usr/lib/python2.7/site-packages/variety/PreferencesVarietyDialog.py", line 191, in reload
    self.copyto_chooser.set_folder(self.parent.get_actual_copyto_folder())
  File "/usr/lib/python2.7/site-packages/variety/FolderChooser.py", line 54, in set_folder
    self.folder = os.path.normpath(folder)
  File "/usr/lib/python2.7/posixpath.py", line 342, in normpath
    initial_slashes = path.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'

Nothing comes up.

Related branches

Revision history for this message
Peter Levi (peterlevi) wrote :

Please make sure you are running the latest version 0.5.1 (to be sure it is not something already outdated).

Some other things to do: please send me your config file (~/.config/variety/variety.conf). Have you configured Variety to use folders on some drive which is not currently mounted?

Peter Levi (peterlevi)
Changed in variety:
status: New → Incomplete
Revision history for this message
Ian Cornwall (ian-ianinit) wrote :

The Arch package was out of date. It just updated to 0.5.1. I updated and tried again. I haven't changed where the config is stored. I just tried removing my config folder and re-setup everything. I get the wizard to enable VRTY.org. When I click the button for already being registered it closes and I can't open the preferences.

Revision history for this message
Peter Levi (peterlevi) wrote :

Ok, let's not chase a moving a target. Please remove the config folder again (or rename it), start Variety in a terminal with -v, reproduce the problem, make sure it is not some window-focusing issue (e.g. the Login window appearing in the background or something like this), then attach here the created log file (~/.config/variety/variety.log). Thanks.

Revision history for this message
Ian Cornwall (ian-ianinit) wrote :

Here is the log file.

Revision history for this message
Ian Cornwall (ian-ianinit) wrote :

I tried clicking the "Participate Anonymously" button and it core dumped on me. Here is the log file from that.

Revision history for this message
Peter Levi (peterlevi) wrote :

Below is the exception in the end. I guess the core dump is triggered by a bug in the exception-handling code.
I will review the related code and see if I can reproduce the conditions for this bug.

In the meantime, please try two things:
1. Run it again with -vvv (this enables heavy debugging) and send me the log file. Let's see if this would reveal more info.
2. Try to manually change the copyto_folder in the config file (~/.config/variety.conf) to some existing folder
like '~/Pictures' and see what happens. Thanks.

Exception:

INFO: 2015-01-13 07:54:50,764: apply() 'Applying preferences'
ERROR: 2015-01-13 07:54:50,767: apply() 'Error while applying preferences'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/variety/PreferencesVarietyDialog.py", line 871, in apply
    copyto = os.path.normpath(self.copyto_chooser.get_folder())
  File "/usr/lib/python2.7/posixpath.py", line 342, in normpath
    initial_slashes = path.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'

Revision history for this message
Peter Levi (peterlevi) wrote :

Actually, I have a clue of which change might have broken this (I assume you have able to run previous versions OK, is this so?).

What is the output of these commands (do this before the previous suggestions)?

python -c "from gi.repository import GLib; print GLib.get_user_special_dir(GLib.USER_DIRECTORY_PICTURES)"
xdg-user-dir PICTURES
cat ~/.config/user-dirs.dirs

Revision history for this message
Ian Cornwall (ian-ianinit) wrote :

Results
1: python -c "from gi.repository import GLib; print GLib.get_user_special_dir(GLib.USER_DIRECTORY_PICTURES)"
None

2:xdg-user-dir PICTURES
/home/ian

3:cat ~/.config/user-dirs.dirs
No such file or directory

I'm attaching the -vvv log.

I enabled copyto and set the folder to something else and I am able to open preferences now.

Revision history for this message
Peter Levi (peterlevi) wrote :

For some reason your XDG folders are not defined. You may want to fix this, as it may affect other software too: https://wiki.archlinux.org/index.php/Xdg_user_directories
I'll fix Variety to handle this case properly.

Peter Levi (peterlevi)
Changed in variety:
status: Incomplete → Fix Committed
importance: Undecided → High
assignee: nobody → Peter Levi (peterlevi)
Peter Levi (peterlevi)
Changed in variety:
importance: High → Critical
Peter Levi (peterlevi)
Changed in variety:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

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