mirror of https://github.com/fail2ban/fail2ban
- Fixed locale bug. Thanks to Fernando Jos�
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@220 a942ae1a-1317-0410-a47c-b1dcaea8d6050.6
parent
52e7a26756
commit
cd38dddd00
12
fail2ban
12
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
|
||||
|
|
Loading…
Reference in New Issue