# HG changeset patch # User Pascal Volk # Date 1250484973 0 # Node ID d1f345f91e1cd791e0933443fc81095551ec2d9e # Parent 50ff50f5055ec14f7ea42f3924f0d9c4a64ce6a6 Hopefully the final UnicodeDecodeError fix for the Config class Added a global w_std() function and replaced all print statements. diff -r 50ff50f5055e -r d1f345f91e1c VirtualMailManager/Config.py --- a/VirtualMailManager/Config.py Sun Aug 16 04:14:38 2009 +0000 +++ b/VirtualMailManager/Config.py Mon Aug 17 04:56:13 2009 +0000 @@ -21,6 +21,11 @@ locale.setlocale(locale.LC_ALL, '') ENCODING = locale.nl_langinfo(locale.CODESET) +def w_std(*args): + for arg in args: + sys.stdout.write(arg.encode(ENCODING, 'replace')) + sys.stdout.write('\n') + class Config(ConfigParser): """This class is for configure the Virtual Mail Manager. @@ -125,11 +130,10 @@ except ValueError: self.set('config', 'done', 'False') self.__changes = True - print _(u"Using configuration file: %s\n").encode(ENCODING, - 'replace') % self.__cfgFileName + w_std(_(u'Using configuration file: %s\n') % self.__cfgFileName) for s in sections: if s != 'config': - print _(u'* Config section: »%s«').encode(ENCODING,'replace')%s + w_std(_(u'* Config section: »%s«') % s ) for opt, val in self.items(s): newval = raw_input( _('Enter new value for option %(opt)s [%(val)s]: ').encode(