Skip to content

Commit

Permalink
[#288] Fix for unicode/latin1 .ini values
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Mar 15, 2013
1 parent 3aa15b2 commit c790b48
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ckan/lib/app_globals.py
Expand Up @@ -109,9 +109,15 @@ def get_config_value(key, default=''):
value = model.get_system_info(key)
else:
value = None
config_value = config.get(key)
# sort encodeings if needed
if isinstance(config_value, str):
try:
config_value = config_value.decode('utf-8')
except UnicodeDecodeError:
config_value = config_value.decode('latin-1')
# we want to store the config the first time we get here so we can
# reset them if needed
config_value = config.get(key)
if key not in _CONFIG_CACHE:
_CONFIG_CACHE[key] = config_value
if value is not None:
Expand Down

0 comments on commit c790b48

Please sign in to comment.