Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2d2fc22

Browse files
committed
Anthony Baxter's patch to expose the parser's `strict' flag in these
convenience functions. Closes SF # 583188 (python project).
1 parent 1693ba8 commit 2d2fc22

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/email/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""A package for parsing, handling, and generating email messages.
55
"""
66

7-
__version__ = '2.1'
7+
__version__ = '2.2'
88

99
__all__ = ['Charset',
1010
'Encoders',
@@ -32,8 +32,8 @@
3232
from email.Parser import Parser as _Parser
3333
from email.Message import Message as _Message
3434

35-
def message_from_string(s, _class=_Message):
36-
return _Parser(_class).parsestr(s)
35+
def message_from_string(s, _class=_Message, strict=1):
36+
return _Parser(_class, strict=strict).parsestr(s)
3737

38-
def message_from_file(fp, _class=_Message):
39-
return _Parser(_class).parse(fp)
38+
def message_from_file(fp, _class=_Message, strict=1):
39+
return _Parser(_class, strict=strict).parse(fp)

0 commit comments

Comments
 (0)