bad paths for config and hiscores in windows

Bug #844884 reported by ccanepa
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Bad paths for config and hiscores in windows

*** Demoing the config path problem:
choose options
start game
modify any seting, by example 'sound volume'
You see a traceback similar to
   File "C:\Python26\share\enjuewemela\enjuewemela\", line 65, in __setit
   File "C:\Python26\lib\site-packages\configglue\", line 557, in save
  fp = open(fp, 'w')
 IOError: [Errno 2] No such file or directory: '/.config\\enjuewemela.conf'

*** Demoing the highscores path problem:
start game
choose new game , rush
play a game.
At gameover you get a traceback similar to
    File "C:\Python26\share\enjuewemela\enjuewemela\", line 602, in game_over
   File "C:\Python26\share\enjuewemela\enjuewemela\", line 337, in save_score
  with open(fname, 'wb') as fh:
 IOError: [Errno 2] No such file or directory: '/.local\\share\\enjuewemela.hs'

*** why ?
paths provided by xdg.BaseDirectory have not much sense in windows.

*** workaround patch
I will paste here the bzr diff, seems that launchpad bug tracker don't allow to attach a file

=== modified file 'enjuewemela/'
--- enjuewemela/ 2011-08-16 21:31:53 +0000
+++ enjuewemela/ 2011-09-08 14:27:15 +0000
@@ -11,6 +11,12 @@
 import os
 import sys

+# workaround for xdg problem in windows, corrects paths to config and hiscores
+import xdg.BaseDirectory as xd
+if sys.platform == 'win32':
+ xd.xdg_config_home = os.path.expanduser('~\\')
+ xd.xdg_data_home = xd.xdg_config_home
 import config

 from cocos.director import director

Revision history for this message
ccanepa (ccanepacc) wrote :

Ah, la opcion de attach es visible solo despues de postear el bug. Bueno, adiciono el diff.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers