Alternate "rt" and "r" gzopen file flag (the "t" is an addition of Python3
gzip, and failed with Python2 on Windows)
check-in: ee1b2744a1 user: mario tags: trunk
# retrieve data from config file def load(self, name):
name = name +".json"
file =self.dir +"/"+ name
try:# .gz or normal fileif os.path.exists(file +".gz"): f = gzip.open(file +".gz","rt") f = gzip.open(file +".gz",self.open_mode)elif os.path.exists(file): f = open(file,"rt") f = open(file,self.open_mode)else:return# file not found# decode
r = json.load(f)
f.close()return r
exceptExceptionas e: