From 6388bc90d43c40945875f57a314668c421352d04 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Tue, 4 Sep 2018 22:19:18 +0100 Subject: [PATCH] =?UTF-8?q?Update=20feedparser=205.2.1=20(5646f4c)=20?= =?UTF-8?q?=E2=86=92=205.2.1=20(2b11c80).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 1 + lib/feedparser/mixin.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index dd8cbd6e..5917fe53 100644 --- a/CHANGES.md +++ b/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] diff --git a/lib/feedparser/mixin.py b/lib/feedparser/mixin.py index 5f97dc80..e5950f8b 100644 --- a/lib/feedparser/mixin.py +++ b/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
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()