From b52e7d337b02af498c58ea859cedf787ecc84202 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Tue, 14 Apr 2009 08:50:24 +0000 Subject: [PATCH] ascii lower whatever locale pisi has. Thanks to Onur for this. --- pisi/db/lazydb.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pisi/db/lazydb.py b/pisi/db/lazydb.py index 50f2eefa..1953097d 100644 --- a/pisi/db/lazydb.py +++ b/pisi/db/lazydb.py @@ -15,6 +15,10 @@ import cPickle import time import pisi.context as ctx +import string +# lower borks for international locales. What we want is ascii lower. +lower_map = string.maketrans(string.ascii_uppercase, string.ascii_lowercase) + class Singleton(object): _the_instances = {} def __new__(type): @@ -38,7 +42,7 @@ class LazyDB(Singleton): return self.initialized def __cache_file(self): - return "/var/cache/pisi/%s.cache" % self.__class__.__name__.lower() + return "/var/cache/pisi/%s.cache" % self.__class__.__name__.translate(lower_map) def cache_save(self): if os.access("/var/cache/pisi", os.W_OK) and self.cacheable: