Fixes string decode with drag-and-drop and non-ASCII chars

This commit is contained in:
albertosottile 2018-03-09 09:50:43 +01:00
parent 42433e0262
commit bfafe1780e

View File

@ -1929,7 +1929,10 @@ class FileSwitchManager(object):
return False
def notifyUserIfFileNotInMediaDirectory(self, filenameToFind, path):
path = path.decode('utf-8')
try:
path = path.decode('utf-8')
except UnicodeEncodeError:
pass
directoryToFind = os.path.dirname(path)
if directoryToFind in self.mediaDirectoriesNotFound:
return