Browse Source

Merge branch 'feature/UpdateFeedParser' into develop

pull/1133/head
JackDandy 7 years ago
parent
commit
eafc3583a8
  1. 1
      CHANGES.md
  2. 10
      lib/feedparser/mixin.py

1
CHANGES.md

@ -4,6 +4,7 @@
* Update CacheControl library 0.12.4 (bd94f7e) to 0.12.5 (cd91309)
* Update Certifi 2018.01.18 (e225253) to 2018.08.24 (8be9f89)
* Update dateutil module 2.7.2 (ff03c0f) to 2.7.2 (49690ee)
* Update feedparser 5.2.1 (5646f4c) to 5.2.1 (2b11c80)
[develop changelog]

10
lib/feedparser/mixin.py

@ -442,6 +442,11 @@ class _FeedParserMixin(
element, expectingText, pieces = self.elementstack.pop()
# Ensure each piece is a str for Python 3
for (i, v) in enumerate(pieces):
if isinstance(v, bytes_):
pieces[i] = v.decode('utf-8')
if self.version == 'atom10' and self.contentparams.get('type', 'text') == 'application/xhtml+xml':
# remove enclosing child element, but only if it is a <div> and
# only if all the remaining content is nested underneath it.
@ -463,11 +468,6 @@ class _FeedParserMixin(
else:
pieces = pieces[1:-1]
# Ensure each piece is a str for Python 3
for (i, v) in enumerate(pieces):
if isinstance(v, bytes_):
pieces[i] = v.decode('utf-8')
output = ''.join(pieces)
if stripWhitespace:
output = output.strip()

Loading…
Cancel
Save