Skip to content

Commit

Permalink
Fixed another possible UnicodeDecodeError when updating feed items. R…
Browse files Browse the repository at this point in the history
  • Loading branch information
maurits committed Sep 2, 2011
1 parent 159ff4c commit d170f25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions Products/feedfeeder/HISTORY.txt
Expand Up @@ -5,6 +5,7 @@ History of feedfeeder
------------------

- Fixed possible UnicodeDecodeError when updating feed items.
Refs http://plone.org/products/feedfeeder/issues/37
[maurits]

- Fixed Plone 4.1 compatibility
Expand Down
7 changes: 4 additions & 3 deletions Products/feedfeeder/utilities.py
Expand Up @@ -3,6 +3,7 @@
from xml.dom import minidom
try:
from hashlib import md5
md5 # pyflakes
except ImportError:
# BBB python2.4
from md5 import md5
Expand Down Expand Up @@ -272,12 +273,12 @@ def _retrieveSingleFeed(self, feedContainer, url):
# use the first 50-70 words as a description
for word in words[45:]:
summarywords.append(word)
if word.endswith(u'.'):
if word.endswith('.'):
# if we encounter a fullstop that will be the
# last word appended to the description
break
summary = u' '.join(summarywords)
if not summary.endswith(u'.'):
summary = ' '.join(summarywords)
if not summary.endswith('.'):
summary = summary + ' ...'
obj.setDescription(summary)

Expand Down

0 comments on commit d170f25

Please sign in to comment.