From: Andrew Browning Date: Tue, 14 Feb 2017 06:01:48 +0000 (-0500) Subject: Fix #5500 UnicodeEncodeError in atom feed X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=741c25fd678a130fddeccf5be10d5e168575ab07;p=mediagoblin.git Fix #5500 UnicodeEncodeError in atom feed This simple fix allows unicode strings in the atom feed thumb and description fields by forcing the entire atom content string to unicode. --- diff --git a/mediagoblin/listings/views.py b/mediagoblin/listings/views.py index fa6b5ba7..6e1528ca 100644 --- a/mediagoblin/listings/views.py +++ b/mediagoblin/listings/views.py @@ -109,7 +109,7 @@ def atom_feed(request): # Include a thumbnail image in content. file_urls = get_media_file_paths(entry.media_files, request.urlgen) if 'thumb' in file_urls: - content = ' {desc}'.format( + content = u' {desc}'.format( thumb=file_urls['thumb'], desc=entry.description_html) else: content = entry.description_html diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py index eaae1bd7..484d27cd 100644 --- a/mediagoblin/user_pages/views.py +++ b/mediagoblin/user_pages/views.py @@ -574,7 +574,7 @@ def atom_feed(request): # Include a thumbnail image in content. file_urls = get_media_file_paths(entry.media_files, request.urlgen) if 'thumb' in file_urls: - content = ' {desc}'.format( + content = u' {desc}'.format( thumb=file_urls['thumb'], desc=entry.description_html) else: content = entry.description_html