CC-3791: Media Monitor crash when there are media files with non-ascii name in watched folder

-move utf-8 locale check to bash
This commit is contained in:
Martin Konecny 2012-05-14 19:46:53 -04:00
parent c1d33e9f72
commit c397a6f797
4 changed files with 20 additions and 16 deletions

View file

@ -11,7 +11,6 @@ import logging.config
import logging.handlers
import locale
import os
import re
from Queue import Queue
from threading import Lock
@ -71,12 +70,7 @@ def configure_locale():
else:
new_locale = default_locale
test = re.compile(r"UTF-?8", re.IGNORECASE)
if test.findall(new_locale):
logger.info("New locale set to: %s", locale.setlocale(locale.LC_ALL, new_locale))
else:
logger.info("Invalid locale %s", new_locale)
sys.exit(1)
logger.info("New locale set to: %s", locale.setlocale(locale.LC_ALL, new_locale))