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.
This commit is contained in:
Andrew Browning 2017-02-14 01:01:48 -05:00
parent 96f66a5fd4
commit 741c25fd67
2 changed files with 2 additions and 2 deletions

View File

@ -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 = '<img src="{thumb}" alt='' /> {desc}'.format(
content = u'<img src="{thumb}" alt='' /> {desc}'.format(
thumb=file_urls['thumb'], desc=entry.description_html)
else:
content = entry.description_html

View File

@ -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 = '<img src="{thumb}" alt='' /> {desc}'.format(
content = u'<img src="{thumb}" alt='' /> {desc}'.format(
thumb=file_urls['thumb'], desc=entry.description_html)
else:
content = entry.description_html