-check whether getdefaultlocale actually returns a value before attempting to use it.
This commit is contained in:
parent
773206ab22
commit
da7b87866c
1 changed files with 8 additions and 5 deletions
|
@ -41,12 +41,15 @@ logger.info("\n\n*** Media Monitor bootup ***\n\n")
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fs_encoding = locale.getdefaultlocale()[1].lower()
|
fs_encoding = locale.getdefaultlocale()[1]
|
||||||
if fs_encoding not in ['utf-8', 'utf8']:
|
if fs_encoding is not None:
|
||||||
logger.error("Filesystem encoding needs to be UTF-8. Currently '%s'. Exiting..." % fs_encoding)
|
if fs_encoding not in ['utf-8', 'utf8']:
|
||||||
sys.exit(1)
|
logger.error("Filesystem encoding needs to be UTF-8. Currently '%s'. Exiting..." % fs_encoding)
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
logger.debug("Filesystem encoding: '%s'" % fs_encoding)
|
||||||
else:
|
else:
|
||||||
logger.debug("Filesystem encoding: '%s'" % fs_encoding)
|
logger.debug("Unknown encoding")
|
||||||
|
|
||||||
|
|
||||||
config = AirtimeMediaConfig(logger)
|
config = AirtimeMediaConfig(logger)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue