Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
702b0460
Commit
702b0460
authored
Jul 15, 2016
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#27522: break unintended cycle in feedparser.
Patch by Costas.
parent
9305bba2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
Lib/email/feedparser.py
Lib/email/feedparser.py
+6
-3
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/email/feedparser.py
View file @
702b0460
...
...
@@ -145,7 +145,7 @@ class FeedParser:
"""
self
.
policy
=
policy
self
.
_
factory_kwds
=
lambda
:
{
'policy'
:
self
.
policy
}
self
.
_
old_style_factory
=
False
if
_factory
is
None
:
# What this should be:
#self._factory = policy.default_message_factory
...
...
@@ -160,7 +160,7 @@ class FeedParser:
_factory
(
policy
=
self
.
policy
)
except
TypeError
:
# Assume this is an old-style factory
self
.
_
factory_kwds
=
lambda
:
{}
self
.
_
old_style_factory
=
True
self
.
_input
=
BufferedSubFile
()
self
.
_msgstack
=
[]
self
.
_parse
=
self
.
_parsegen
().
__next__
...
...
@@ -197,7 +197,10 @@ class FeedParser:
return
root
def
_new_message
(
self
):
msg
=
self
.
_factory
(
**
self
.
_factory_kwds
())
if
self
.
_old_style_factory
:
msg
=
self
.
_factory
()
else
:
msg
=
self
.
_factory
(
policy
=
self
.
policy
)
if
self
.
_cur
and
self
.
_cur
.
get_content_type
()
==
'multipart/digest'
:
msg
.
set_default_type
(
'message/rfc822'
)
if
self
.
_msgstack
:
...
...
Misc/NEWS
View file @
702b0460
...
...
@@ -24,6 +24,8 @@ Core and Builtins
Library
-------
- Issue #27522: Avoid an unintentional reference cycle in email.feedparser.
- Issue #26844: Fix error message for imp.find_module() to refer to '
path
'
instead of '
name
'. Patch by Lev Maximov.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment