summaryrefslogtreecommitdiffstats
path: root/Lib/email
Commit message (Collapse)AuthorAgeFilesLines
* bpo-29412: Fix indexError when parsing a header value ending unexpectedly ↵Abhilash Raj2019-06-261-0/+3
| | | | | | | (GH-14387) * patched string index out of range error in get_word function of _header_value_parser.py and created tests in test__header_value_parser.py for CFWS. * Raise HeaderParseError instead of continuing when parsing a word.
* bpo-33972: Fix EmailMessage.iter_attachments raising AttributeError. (GH-14119)Abhilash Raj2019-06-251-1/+10
| | | | | | | * bpo-33972: Fix EmailMessage.iter_attachments raising AttributeError. When certain malformed messages have content-type set to 'mulitpart/*' but still have a single part body, iter_attachments can raise AttributeError. This patch fixes it by returning a None value instead when the body is single part.
* bpo-36520: Email header folded incorrectly (#13608)websurfer52019-06-061-0/+1
| | | | | | | | | | | | | | | | | * bpo-36520: reset the encoded word offset when starting a new line during an email header folding operation * 📜🤖 Added by blurb_it. * bpo-36520: add an additional test case, and provide descriptive comments for the test_folding_with_utf8_encoding_* tests * bpo-36520: fix whitespace issue * bpo-36520: changes per reviewer request -- remove extraneous backslashes; add whitespace between terminating quotes and line-continuation backslashes; use "bpo-" instead of "issue #" in comments
* bpo-21315: Fix parsing of encoded words with missing leading ws. (#13425)Abhilash Raj2019-06-051-0/+21
| | | | | | | | | | | | * bpo-21315: Fix parsing of encoded words with missing leading ws. Because of missing leading whitespace, encoded word would get parsed as unstructured token. This patch fixes that by looking for encoded words when splitting tokens with whitespace. Missing trailing whitespace around encoded word now register a defect instead. Original patch suggestion by David R. Murray on bpo-21315.
* bpo-30835: email: Fix AttributeError when parsing invalid CTE (GH-13598)Abhilash Raj2019-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | * bpo-30835: email: Fix AttributeError when parsing invalid Content-Transfer-Encoding Parsing an email containing a multipart Content-Type, along with a Content-Transfer-Encoding containing an invalid (non-ASCII-decodable) byte will fail. email.feedparser.FeedParser._parsegen() gets the header and attempts to convert it to lowercase before comparing it with the accepted encodings, but as the header contains an invalid byte, it's returned as a Header object rather than a str. Cast the Content-Transfer-Encoding header to a str to avoid this. Found using the AFL fuzzer. Reported-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Andrew Donnellan <andrew@donnellan.id.au> * Add email and NEWS entry for the bugfix.
* bpo-35805: Add parser for Message-ID email header. (GH-13397)Abhilash Raj2019-06-042-15/+135
| | | | | | | | | | | | | * bpo-35805: Add parser for Message-ID header. This parser is based on the definition of Identification Fields from RFC 5322 Sec 3.6.4. This should also prevent folding of Message-ID header using RFC 2047 encoded words and hence fix bpo-35805. * Prevent folding of non-ascii message-id headers. * Add fold method to MsgID token to prevent folding.
* Fix typos in docs and docstrings (GH-13745)Xtreak2019-06-021-1/+1
|
* bpo-27737: Allow whitespace only headers encoding (#13478)Batuhan Taşkaya2019-05-231-1/+1
|
* bpo-33524: Fix the folding of email header when max_line_length is 0 or None ↵Abhilash Raj2019-05-172-2/+4
| | | | | (#13391) and there are non-ascii characters in the header.
* bpo-33529, email: Fix infinite loop in email header encoding (GH-12020)Krzysztof Wojcik2019-05-141-10/+13
|
* bpo-34424: Handle different policy.linesep lengths correctly. (#8803)Jens Troeger2019-05-141-1/+1
|
* bpo-36793: Remove unneeded __str__ definitions. (GH-13081)Serhiy Storchaka2019-05-061-3/+1
| | | | Classes that define __str__ the same as __repr__ can just inherit it from object.
* email: use dict instead of OrderedDict (GH-11709)Inada Naoki2019-02-051-2/+1
|
* bpo-35133: Fix mistakes when concatenate string literals on different lines. ↵Serhiy Storchaka2018-11-051-2/+2
| | | | | | | | | | (GH-10284) Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings.
* bpo-33476: Fix _header_value_parser when address group is missing final ';' ↵Dong-hee Na2018-07-281-1/+1
| | | | (GH-7484)
* bpo-27397: Make email module properly handle invalid-length base64 strings ↵Tal Einat2018-06-122-18/+33
| | | | | | | (#7583) When attempting to base64-decode a payload of invalid length (1 mod 4), properly recognize and handle it. The given data will be returned as-is, i.e. not decoded, along with a new defect, InvalidBase64LengthDefect.
* bpo-32746: Fix multiple typos (GH-5144)Leo Arias2018-02-041-2/+2
| | | Fix typos found by codespell in docs, docstrings, and comments.
* bpo-27931: Fix email address header parsing error (#5329)jayyyin2018-01-291-1/+7
| | | | Correctly handle addresses whose username is an empty quoted string.
* bpo-32297: Few misspellings found in Python source code comments. (#4803)Mike2017-12-141-1/+1
| | | | | | | | * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py
* bpo-27240 Rewrite the email header folding algorithm. (#3488)R. David Murray2017-12-032-446/+292
| | | | | | | | | | | | | | | | | | | | | The original algorithm tried to delegate the folding to the tokens so that those tokens whose folding rules differed could specify the differences. However, this resulted in a lot of duplicated code because most of the rules were the same. The new algorithm moves all folding logic into a set of functions external to the token classes, but puts the information about which tokens can be folded in which ways on the tokens...with the exception of mime-parameters, which are a special case (which was not even implemented in the old folder). This algorithm can still probably be improved and hopefully simplified somewhat. Note that some of the test expectations are changed. I believe the changes are toward more desirable and consistent behavior: in general when (re) folding a line the canonical version of the tokens is generated, rather than preserving errors or extra whitespace.
* bpo-30349: Raise FutureWarning for nested sets and set operations (#1553)Serhiy Storchaka2017-11-161-5/+4
| | | | in regular expressions.
* bpo-31677: email: Remove re.IGNORECASE flag (GH-3868)INADA Naoki2017-10-042-14/+2
| | | | | | | | | While there is not real bug in this case, using re.IGNORECASE without re.ASCII leads unexpected behavior. Instead of adding re.ASCII, this commit removes re.IGNORECASE flag because it's easier and simpler. This commit removes dead copy of the pattern in email.util module too. While the pattern is same, it is compiled separately because it had different flags.
* bpo-31507 Add docstring to parseaddr function in email.utils.parseaddr (gh-3647)Rohit Balasubramanian2017-09-191-0/+6
|
* bpo-30532: Fix whitespace folding in certain casesJoel Hillacre2017-06-261-3/+1
| | | Leading whitespace was incorrectly dropped during folding of certain lines in the _header_value_parser's folding algorithm. This makes the whitespace handling code consistent.
* [email] bpo-29478: Fix passing max_line_length=None from Compat32 policy ↵mircea-cosbuc2017-06-121-2/+6
| | | | | | (GH-595) If max_line_length=None is specified while using the Compat32 policy, it is no longer ignored.
* Fix typos in multiple `.rst` files (#1668)delirious-lettuce2017-05-191-1/+1
|
* bpo-30296 Remove unnecessary tuples, lists, sets, and dicts (#1489)Jon Dufresne2017-05-181-2/+2
| | | | | | | | * Replaced list(<generator expression>) with list comprehension * Replaced dict(<generator expression>) with dict comprehension * Replaced set(<list literal>) with set literal * Replaced builtin func(<list comprehension>) with func(<generator expression>) when supported (e.g. any(), all(), tuple(), min(), & max())
* Fixed a type error introduced in issue #28992.Serhiy Storchaka2016-12-211-1/+1
|
* Issue #28992: Use bytes.fromhex().Serhiy Storchaka2016-12-211-1/+1
|
* Merge: #19003: Only replace \r and/or \n line endings in email.generator.R David Murray2016-09-111-6/+10
|
* #20476: Deal with the message_factory circular import differently.R David Murray2016-09-103-5/+6
| | | | | | | It turns out we can't depend on email.message getting imported every place message_factory is needed, so to avoid a circular import we need to special case Policy.message_factory=None in the parser instead of using monkey patching. I had a feeling that was a bad idea when I did it.
* #20476: add a message_factory policy attribute to email.R David Murray2016-09-094-11/+12
|
* Merge with 3.5Steve Dower2016-09-091-4/+5
|\
| * #28047: Fix calculation of base64 line length.R David Murray2016-09-091-4/+5
| | | | | | | | | | This is buggy in the old email code as well, but it doesn't affect anything there because only the default line length is ever used there.
* | Merge: #27630: Be consistent in how _XXX/_encoded_XXX vars are initialized.R David Murray2016-09-091-9/+1
|\ \ | |/
| * #27630: Be consistent in how _XXX/_encoded_XXX vars are initialized.R David Murray2016-09-091-9/+1
| |
* | Add policy keyword to email.generator.DecodedGenerator.R David Murray2016-09-081-2/+4
| |
* | #27364: fix "incorrect" uses of escape character in the stdlib.R David Murray2016-09-082-12/+12
| | | | | | | | | | | | | | And most of the tools. Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and Martin Panter.
* | Issue #27445: Merge from 3.5Berker Peksag2016-09-081-3/+1
|\ \ | |/
| * Issue #27445: Don't pass str(_charset) to MIMEText.set_payload()Berker Peksag2016-09-081-3/+1
| | | | | | | | Patch by Claude Paroz.
| * Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Martin Panter2016-09-071-1/+1
| |
* | #24277: The new email API is no longer provisional.R David Murray2016-09-081-0/+20
| | | | | | | | | | | | | | This is a wholesale reorganization and editing of the email documentation to make the new API the standard one, and the old API the 'legacy' one. The default is still the compat32 policy, for backward compatibility. We will change that eventually.
* | Merge: #22233: Only split headers on \r and/or \n, per email RFCs.R David Murray2016-09-072-17/+25
|\ \ | |/
| * #22233: Only split headers on \r and/or \n, per email RFCs.R David Murray2016-09-072-17/+25
| | | | | | | | Original patch by Martin Panter, new policy fixes by me.
* | #27331: add policy keyword argument to all MIME subclasses.R David Murray2016-09-077-13/+21
| | | | | | | | Patch by Berker Peksag.
* | Merge: 27988: Make sure iter_attachments does not mutate the payload list.R David Murray2016-09-071-1/+1
|\ \ | |/
| * 27988: Make sure iter_attachments does not mutate the payload list.R David Murray2016-09-071-1/+1
| |
* | Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger2016-08-304-7/+7
|/
* Correct misspellings of ISO-8859Martin Panter2016-08-102-2/+2
|
* Issues #23147, #23148: Presumably fixed bugs in folding UnstructuredTokenList.Serhiy Storchaka2016-07-171-2/+2
|