From 01c8664aa663fed2bd21c0ce3c4532ddf592dabe Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Fri, 10 May 2019 15:28:23 +0700 Subject: [PATCH] Fix PhotoAlbum#__str__ for UTF-8 album titles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The __str__ method was crashing when an album title contained UTF-8 characters, such as an umlaut: "Jörg" --- pyicloud/services/photos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyicloud/services/photos.py b/pyicloud/services/photos.py index 47d2e37..e2dc74b 100644 --- a/pyicloud/services/photos.py +++ b/pyicloud/services/photos.py @@ -403,7 +403,7 @@ class PhotoAlbum(object): if sys.version_info[0] >= 3: return as_unicode else: - return as_unicode.encode('ascii', 'ignore') + return as_unicode.encode('utf-8', 'ignore') def __repr__(self): return "<%s: '%s'>" % (