Fix PhotoAlbum#__str__ for UTF-8 album titles

The __str__ method was crashing when an album title contained UTF-8 characters, such as an umlaut: "Jörg"
This commit is contained in:
Nathan Broadbent 2019-05-10 15:28:23 +07:00 committed by GitHub
parent 9bb6d75066
commit 01c8664aa6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -403,7 +403,7 @@ class PhotoAlbum(object):
if sys.version_info[0] >= 3: if sys.version_info[0] >= 3:
return as_unicode return as_unicode
else: else:
return as_unicode.encode('ascii', 'ignore') return as_unicode.encode('utf-8', 'ignore')
def __repr__(self): def __repr__(self):
return "<%s: '%s'>" % ( return "<%s: '%s'>" % (