-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:
|
||||
fs_encoding = locale.getdefaultlocale()[1].lower()
|
||||
if fs_encoding not in ['utf-8', 'utf8']:
|
||||
logger.error("Filesystem encoding needs to be UTF-8. Currently '%s'. Exiting..." % fs_encoding)
|
||||
sys.exit(1)
|
||||
fs_encoding = locale.getdefaultlocale()[1]
|
||||
if fs_encoding is not None:
|
||||
if fs_encoding not in ['utf-8', 'utf8']:
|
||||
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:
|
||||
logger.debug("Filesystem encoding: '%s'" % fs_encoding)
|
||||
logger.debug("Unknown encoding")
|
||||
|
||||
|
||||
config = AirtimeMediaConfig(logger)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue