From 5fe361460d2a991c8b8719acb04471c614f8bca6 Mon Sep 17 00:00:00 2001 From: lostcontrol Date: Fri, 16 Dec 2005 23:44:34 +0000 Subject: [PATCH] =?UTF-8?q?-=20Fixed=20locale=20bug.=20Thanks=20to=20Ferna?= =?UTF-8?q?ndo=20Jos=EF=BF=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@220 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- fail2ban | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fail2ban b/fail2ban index 05213f9e..9b0d4866 100755 --- a/fail2ban +++ b/fail2ban @@ -26,7 +26,14 @@ __date__ = "$Date$" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -import sys, traceback, logging +import sys, traceback, logging, locale + +# Set the locale with the user's default setting +try: + locale.setlocale(locale.LC_ALL, '') +except Exception: + print "Unable to set locale to " + `locale.getdefaultlocale()` + sys.exit(-1) # Appends our own modules path. sys.path.append("/usr/lib/fail2ban") @@ -41,8 +48,9 @@ logSys = logging.getLogger("fail2ban") # Get PID lock file instance pidLock = PIDLock() -# Start the application. Handle all the unhandled exceptions +# Handle all the unhandled exceptions try: + # Start the application fail2ban.main() except SystemExit: # We called sys.exit(). Nothing wrong so just pass