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

-debug info
This commit is contained in:
Martin Konecny 2012-05-09 12:21:53 -04:00
parent be2e62c3d1
commit 3b2e812e51
1 changed files with 2 additions and 0 deletions
python_apps/media-monitor

View File

@ -26,6 +26,7 @@ from airtimefilemonitor.workerprocess import MediaMonitorWorkerProcess
from airtimefilemonitor.airtimemediamonitorbootstrap import AirtimeMediaMonitorBootstrap
def configure_locale():
logger.debug("Before %s", locale.nl_langinfo(locale.CODESET))
current_locale = locale.getlocale()
if current_locale[1] is None:
@ -48,6 +49,7 @@ def configure_locale():
current_locale_encoding = locale.getlocale()[1].lower()
logger.debug("After %s", locale.nl_langinfo(locale.CODESET))
if current_locale_encoding not in ['utf-8', 'utf8']:
logger.error("Need a UTF-8 locale. Currently '%s'. Exiting..." % current_locale_encoding)