-decoding exec_command from UTF-8 multiple times (bad)

This commit is contained in:
Martin Konecny 2012-03-26 10:57:56 -04:00
parent 0525f182ef
commit 4f5b9a0c91

View file

@ -265,15 +265,7 @@ class MediaMonitorCommon:
def scan_dir_for_new_files(self, dir):
command = 'find "%s" -type f -iname "*.ogg" -o -iname "*.mp3" -readable' % dir.replace('"', '\\"')
self.logger.debug(command)
stdout = self.exec_command(command).decode("UTF-8")
try:
"""
File name charset encoding is UTF-8.
"""
stdout = stdout.decode("UTF-8")
except Exception, e:
self.logger.error("Could not decode %s using UTF-8" % stdout)
stdout = self.exec_command(command)
return stdout.splitlines()