tarmac depends on python-xdg but doesn't say so

Bug #415645 reported by Diogo Matsubara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Tarmac
Fix Released
High
Diogo Matsubara

Bug Description

On a Ubuntu system without python-xdg package installed, try to run tarmac-authenticate.
You'll get the following traceback:

Traceback (most recent call last):
  File "./tarmac-authenticate", line 19, in <module>
    from tarmac.bin import TarmacAuthenticate
  File "/home/pqm/tarmac/trunk/tarmac/bin.py", line 31, in <module>
    from tarmac.branch import Branch
  File "/home/pqm/tarmac/trunk/tarmac/branch.py", line 30, in <module>
    from tarmac.config import TarmacConfig
  File "/home/pqm/tarmac/trunk/tarmac/config.py", line 25, in <module>
    from tarmac.xdgdirs import xdg_config_home, xdg_cache_home
ImportError: cannot import name xdg_config_home

Installing python-xdg get rids of the problem.

Tarmac should say in the documentation that it depends on python-xdg or a fallback for Linux systems without python-xdg should be added to xdgdirs.py Try something like:

=== modified file 'tarmac/xdgdirs.py'
--- tarmac/xdgdirs.py 2009-07-15 03:01:14 +0000
+++ tarmac/xdgdirs.py 2009-08-18 22:56:18 +0000
@@ -28,6 +28,10 @@
         from bzrlib import win32utils as win
         xdg_config_home = win.get_appdata_location_unicode()
         xdg_cache_home = get_temp_location()
+ else:
+ home = os.environ.get('HOME')
+ xdg_config_home = os.path.join(home, '.config/')
+ xdg_cache_home = os.path.join(home, '.cache/')

 # XXX This function should be merged into bzrlib.win32utils

Related branches

Revision history for this message
Paul Hummer (rockstar) wrote :

Oh crap. I didn't see that. I thought we had implemented it in such a way that it didn't require python-xdg. That means the problem we were having is quite simple, actually. We just need to hardcode the platform path in there if it can't find xdg, methinks.

This is a blocker for Launchpad to adopt tarmac.

Changed in tarmac:
importance: Undecided → High
status: New → Triaged
description: updated
Changed in tarmac:
assignee: nobody → Diogo Matsubara (matsubara)
status: Triaged → In Progress
Revision history for this message
Diogo Matsubara (matsubara) wrote :

Fix committed on r146 tarmac trunk

Changed in tarmac:
status: In Progress → Fix Committed
Paul Hummer (rockstar)
Changed in tarmac:
milestone: none → tarmac-0.3
Paul Hummer (rockstar)
Changed in tarmac:
status: Fix Committed → 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.