summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_email/test_headerregistry.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #23277: Remove unused imports in tests.Serhiy Storchaka2016-04-241-1/+0
|
* #21991: make headerregistry params property MappingProxyType.R David Murray2014-10-171-0/+3
| | | | | | | | | It is unlikely anyone is using the fact that the dictionary returned by the 'params' attribute was previously writable, but even if someone is the API is provisional so this kind of change is acceptable (and needed, to get the API "right" before it becomes official). Patch by Stéphane Wirtel.
* Merge: #16983: Apply postel's law to encoded words inside quoted strings.R David Murray2014-02-081-0/+10
|\
| * #16983: Apply postel's law to encoded words inside quoted strings.R David Murray2014-02-081-0/+10
| | | | | | | | | | | | | | | | | | | | This applies only to the new parser. The old parser decodes encoded words inside quoted strings already, although it gets the whitespace wrong when it does so. This version of the patch only handles the most common case (a single encoded word surrounded by quotes), but I haven't seen any other variations of this in the wild yet, so its good enough for now.
* | #18891: Complete new provisional email API.R David Murray2013-10-171-1/+13
|/ | | | | | | | | | | | This adds EmailMessage and, MIMEPart subclasses of Message with new API methods, and a ContentManager class used by the new methods. Also a new policy setting, content_manager. Patch was reviewed by Stephen J. Turnbull and Serhiy Storchaka, and reflects their feedback. I will ideally add some examples of using the new API to the documentation before the final release.
* #18741: fix more typos. Patch by Févry Thibault.Ezio Melotti2013-08-171-6/+6
|
* #18431: Decode encoded words in atoms in new email parser.R David Murray2013-07-121-0/+24
| | | | | | There is more to be done here in terms of accepting RFC invalid input that some mailers accept, but this covers the valid RFC places where encoded words can occur in structured headers.
* #18044: Fix parsing of encoded words of the form =?utf8?q?=XX...?=R David Murray2013-07-111-4/+37
| | | | | | | | | | The problem was I was only checking for decimal digits after the third '?', not for *hex* digits :(. This changeset also fixes a couple of comment typos, deletes an unused function relating to encoded word parsing, and removed an invalid 'if' test from the folding function that was revealed by the tests written to validate this issue.
* Fix a few typos and a double semicolon. Patch by Eitan Adler.Ezio Melotti2013-01-271-1/+1
|
* #15160: Extend the new email parser to handle MIME headers.R David Murray2012-06-241-0/+786
| | | | | | | | | | | | | | | | | | | | | | | This code passes all the same tests that the existing RFC mime header parser passes, plus a bunch of additional ones. There are a couple of commented out tests where there are issues with the folding. The folding doesn't normally get invoked for headers parsed from source, and the cases are marginal anyway (headers with invalid binary data) so I'm not worried about them, but will fix them after the beta. There are things that can be done to make this API even more convenient, but I think this is a solid foundation worth having. And the parser is a full RFC parser, so it handles cases that the current parser doesn't. (There are also probably cases where it fails when the current parser doesn't, but I haven't found them yet ;) Oh, yeah, and there are some really ugly bits in the parser for handling some 'postel' cases that are unfortunately common. I hope/plan to to eventually refactor a lot of the code in the parser which should reduce the line count...but there is no escaping the fact that the error recovery is welter of special cases.
* Don't use metaclasses when class decorators can do the job.R David Murray2012-05-311-2/+3
| | | | | Thanks to Nick Coghlan for pointing out that I'd forgotten about class decorators.
* Make parameterized tests in email less hackish.R David Murray2012-05-311-18/+8
| | | | | Or perhaps more hackish, depending on your perspective. But at least this way it is now possible to run the individual tests using the unittest CLI.
* Regularize test_email/test_headerregistry's references to policy.R David Murray2012-05-291-6/+6
|
* Make headerregistry fully part of the provisional api.R David Murray2012-05-271-0/+738
When I made the checkin of the provisional email policy, I knew that Address and Group needed to be made accessible from somewhere. The more I looked at it, though, the more it became clear that since this is a provisional API anyway, there's no good reason to hide headerregistry as a private API. It was designed to ultimately be part of the public API, and so it should be part of the provisional API. This patch fully documents the headerregistry API, and deletes the abbreviated version of those docs I had added to the provisional policy docs.