Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1157)

Unified Diff: Lib/email/feedparser.py

Issue 4661: email.parser: impossible to read messages encoded in a different encoding
Patch Set: Created 2 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/email/__init__.py ('k') | Lib/email/generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Lib/email/feedparser.py
===================================================================
--- Lib/email/feedparser.py (revision 85238)
+++ Lib/email/feedparser.py (working copy)
@@ -482,3 +482,10 @@
if lastheader:
# XXX reconsider the joining of folded lines
self._cur[lastheader] = EMPTYSTRING.join(lastvalue).rstrip('\r\n')
+
+
+class BytesFeedParser(FeedParser):
+ """Like FeedParser, but feed accepts bytes."""
+
+ def feed(self, data):
+ super().feed(data.decode('ascii', 'surrogateescape'))
« no previous file with comments | « Lib/email/__init__.py ('k') | Lib/email/generator.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7