Merge pull request #866 from croneter/fix-unicode

Fix rare UnicodeDecodeError on library sync
This commit is contained in:
croneter 2019-06-12 13:03:48 +02:00 committed by GitHub
commit 04a6db6a21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -138,12 +138,12 @@ class File(object):
return
try:
if force_first_media is False:
ans = cast(str, self.xml[self.mediastream][self.part].attrib['file'])
ans = self.xml[self.mediastream][self.part].attrib['file']
else:
ans = cast(str, self.xml[0][self.part].attrib['file'])
ans = self.xml[0][self.part].attrib['file']
except (TypeError, AttributeError, IndexError, KeyError):
return
return utils.unquote(ans)
return ans
def get_picture_path(self):
"""