#Read a configuration file as global config
global globalProfileParser
globalProfileParser = ConfigParser.ConfigParser()
- globalProfileParser.read(filename)
+ try:
+ globalProfileParser.read(filename)
+ except ConfigParser.ParsingError:
+ pass
def resetGlobalProfile():
#Read a configuration file as global config
global globalPreferenceParser
if globalPreferenceParser is None:
globalPreferenceParser = ConfigParser.ConfigParser()
- globalPreferenceParser.read(getPreferencePath())
+ try:
+ globalPreferenceParser.read(getPreferencePath())
+ except ConfigParser.ParsingError:
+ pass
if not globalPreferenceParser.has_option('preference', name):
if name in preferencesDefaultSettings:
default = preferencesDefaultSettings[name]
global globalPreferenceParser
if globalPreferenceParser == None:
globalPreferenceParser = ConfigParser.ConfigParser()
- globalPreferenceParser.read(getPreferencePath())
+ try:
+ globalPreferenceParser.read(getPreferencePath())
+ except ConfigParser.ParsingError:
+ pass
if not globalPreferenceParser.has_section('preference'):
globalPreferenceParser.add_section('preference')
globalPreferenceParser.set('preference', name, unicode(value).encode("utf-8"))