sommer / loxodo

Password Safe V3 compatible Password Vault
http://www.christoph-sommer.de/loxodo
GNU General Public License v2.0
76 stars 38 forks source link

config.get_config_filename tries to return unset property #5

Open jackric opened 14 years ago

jackric commented 14 years ago

Running under cygwin,

Traceback (most recent call last): File "./loxodo.py", line 13, in from src.config import config File "/cygdrive/C/loxodo/sommer-loxodo-afb514c/src/config.py", line 149, in config = Config() File "/cygdrive/C/loxodo/sommer-loxodo-afb514c/src/config.py", line 45, in init self._fname = self.get_config_filename() File "/cygdrive/C/loxodo/sommer-loxodo-afb514c/src/config.py", line 142, in get_config_filename base_path = os.path.dirname(config.get_basescript()) NameError: global name 'config' is not defined

get_config_filename is supposed to be a static method and it's calling on the instance 'config' which is not defined yet since we're still in the flow of init()

Can fix by changing line 140 from: base_path = os.path.dirname(config.get_basescript()) to base_path = os.path.dirname(unicode(file, sys.getfilesystemencoding()))

Needs an import sys at the top of config.py though.

Is there a cleaner way of doing this?