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