"Added music" multimedia test fails if XDG_MUSIC_DIR does not start $HOME

Bug #1254612 reported by David
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Accomplishments Daemon
New
Undecided
Unassigned

Bug Description

Steps to reproduce:

 * Running Accomplishments 0.3~precise2 from stable PPA
 * Set XDG_MUSIC_DIR to any path not starting with $HOME (e.g. /home/shared/Music as opposed to $HOME/Music)
 * Wait for "Added music" test to run

What should happen:

 * Test runs against alternate folder

What happens instead:

2013-11-23 12:23:48+0200 [-] Running ubuntu-desktop/multimedia-added-music, left on queue: 14
2013-11-23 12:23:48+0200 [-] 'Got non-zero exit code for process: '
2013-11-23 12:23:48+0200 [-] Traceback (most recent call last):
   File "/usr/share/accomplishments/scripts/ubuntu-desktop/multimedia/multimedia-added-music.py", line 33, in <module>
     test_for_music(music)
   File "/usr/share/accomplishments/scripts/ubuntu-desktop/multimedia/multimedia-added-music.py", line 16, in test_for_music
     dirList = os.listdir(directory)
 OSError: [Errno 2] No such file or directory: '/home/username/shared/Music'

Revision history for this message
David (lofidevops) wrote :

The test in this PPA matches the latest from the code repository. The following change stopped the bug, and allowed me to earn the trophy:

...

if musicDir[15:20] == "$HOME":
    # generate home-based path
    music = os.path.join(homedir, musicDir[21:-2])
else:
    # extract non-home-based path
    music = musicDir[15:-2]

# test valid path for music
if os.path.isdir(music):
    test_for_music(music)

#user has no music
sys.exit(1)

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.