summaryrefslogtreecommitdiffstats
path: root/Lib/email
Commit message (Collapse)AuthorAgeFilesLines
* SF bug #1347874; FeedParser does not comply with RFC2822.Barry Warsaw2006-01-172-2/+11
| | | | | Change headerRE as suggested in the bug report, so that single character headers are accepted. Test case added too. Will backport to Python 2.4.
* Ported 42075 from release23-maint branch.Barry Warsaw2006-01-174-5/+51
| | | | | | | | | | | SF bug #1403349 solution for email 3.0; some MUAs use the 'file' parameter name in the Content-Distribution header, so Message.get_filename() should fall back to using that. Will port to the Python 2.5 trunk. Also, bump the email package version to 3.0.1 for eventual release. Of course, add a test case too. XXX Need to update the documentation.
* fix broken (unexecuted) testAnthony Baxter2005-06-081-3/+3
|
* Fixes for SF #1076485, which I'll apply to the CVS head too. The problem wasBarry Warsaw2004-12-054-4/+274
| | | | | | | | | | | | | | | | caused by a self._input.readline() call that wasn't checking for the NeedsMoreData marker. msg_43.txt contains a message that illustrates the problem, when email.message_from_*() is called. That interface uses the Parser API, which splits reads into 8192 byte chunks. It so happens that for the test message, the 8192 chunk falls inside a message/delivery-status, which is where in the FeedParser the readline() call was that didn't check for NeedsMoreData. I also added an assert to unreadline() so it'll be more evident if an attempt to push back NeedsMoreData ever happens again. Bump the email package version number.
* RFC 2822 describes the characters allowed in a header field name. Conform toBarry Warsaw2004-11-292-1/+19
| | | | this, and add test cases.
* There's likely nothing more to do to the email package before Python 2.4 isBarry Warsaw2004-11-291-1/+1
| | | | final, so I'm marking email's version number as "3.0" (e.g. final).
* Fix for SF bug #1072623. When the last line of the input string does not endBarry Warsaw2004-11-282-1/+16
| | | | | | | | | in a newline, and it's an end boundary, the FeedParser wasn't recognizing it as such. Tweak the regexp to make the ending linesep optional. For grins, clear self._partial when closing the BufferedSubFile. Added a test case.
* get_boundary(): Fix for SF bug #1060941. RFC 2046 says boundaries may beginBarry Warsaw2004-11-061-1/+2
| | | | | | -- but not end -- with whitespace. I will backport to Python 2.3.
* test_boundary_with_leading_space(): Test case for SF bug #1060941. RFC 2046Barry Warsaw2004-11-061-0/+19
| | | | | | says boundaries may begin -- but not end -- with whitespace. I will backport to Python 2.3.
* Whitespace normalization.Tim Peters2004-10-121-1/+1
|
* Added a usegmt flag to email.Utils.formatdate - this allows it to beAnthony Baxter2004-10-112-2/+18
| | | | | used to replace rfc822.formatdate for protocols like HTTP (where 'GMT' must be the timezone string).
* All known bugs are closed, and Python 2.4b1 is coming out soon, so bumpBarry Warsaw2004-10-091-1/+1
| | | | email's version number to 3.0b1.
* Fix SF bug # 1030941. In _parsegen(), in the clause where we'reBarry Warsaw2004-10-091-3/+7
| | | | | | | capturing_preamble but we found a StartBoundaryNotFoundDefect, we need to consume all lines from the current position to the EOF, which we'll set as the epilogue of the current message. If we're not at EOF when we return from here, the outer message's capturing_preamble assertion will fail.
* An example message for SF bug # 1030941.Barry Warsaw2004-10-091-0/+20
|
* test_missing_start_boundary(): A test for SF bug # 1030941.Barry Warsaw2004-10-091-0/+15
|
* __init__(): Coerce the input_charset to unicode (with ascii encoding) beforeBarry Warsaw2004-10-091-2/+3
| | | | | | calling .lower() on it. This fixes the problem described in SF patch # 866982 where in the tr_TR.ISO-8859-9 locale, 'I'.lower() isn't 'i'. unicodes are locale insensitive.
* Fix test for FeedParser results.Barry Warsaw2004-10-031-2/+2
|
* as_string(): Indicate that this mangles From_ lines.Barry Warsaw2004-10-031-1/+2
|
* Big email 3.0 API changes, with updated unit tests and documentation.Barry Warsaw2004-10-0324-371/+230
| | | | | | | | | | | | | | | | | Briefly (from the NEWS file): - Updates for the email package: + All deprecated APIs that in email 2.x issued warnings have been removed: _encoder argument to the MIMEText constructor, Message.add_payload(), Utils.dump_address_pair(), Utils.decode(), Utils.encode() + New deprecations: Generator.__call__(), Message.get_type(), Message.get_main_type(), Message.get_subtype(), the 'strict' argument to the Parser constructor. These will be removed in email 3.1. + Support for Python earlier than 2.3 has been removed (see PEP 291). + All defect classes have been renamed to end in 'Defect'. + Some FeedParser fixes; also a MultipartInvariantViolationDefect will be added to messages that claim to be multipart but really aren't. + Updates to documentation.
* Test cases and fixes for bugs described in patch #873418: email/Message.py:Barry Warsaw2004-08-162-2/+14
| | | | del_param fails when specifying a header.
* Resolution of bug #997368, "strftime() backward compatibility".Barry Warsaw2004-08-072-3/+3
| | | | | | | | | Specifically, time.strftime() no longer accepts a 0 in the yday position of a time tuple, since that can crash some platform strftime() implementations. parsedate_tz(): Change the return value to return 1 in the yday position. Update tests in test_rfc822.py and test_email.py
* Resolution of SF bug #1002475 and patch #1003693; Header lines that end inBarry Warsaw2004-08-072-3/+33
| | | | | | | | | | \r\n only get the \n stripped, not the \r (unless it's the last header which does get the \r stripped). Patch by Tony Meyer. test_whitespace_continuation_last_header(), test_strip_line_feed_and_carriage_return_in_headers(): New tests. _parse_headers(): Be sure to strip \r\n from the right side of header lines.
* _parsegen(): Add a missing check for NeedMoreData.Barry Warsaw2004-05-151-0/+3
|
* forward porting from release23-maintBarry Warsaw2004-05-131-0/+10
|
* test_boundary_in_non_multipart(): Added a test for SF bug # 846938.Barry Warsaw2004-05-131-0/+15
|
* encode_7or8bit(): Clearing out some old patches; iso-2202 is non-ASCII butBarry Warsaw2004-05-131-5/+10
| | | | still 7-bit.
* readline(): RFC 2046, section 5.1.2 (and partially 5.1) both state that theBarry Warsaw2004-05-131-3/+5
| | | | | | | | | | parser must recognize outer boundaries in inner parts. So cruise through the EOF stack backwards testing each predicate against the current line. There's still some discussion about whether this is (always) the best thing to do. Anthony would rather parse these messages as if the outer boundaries were ignored. I think that's counter to the RFC, but might be practically more useful. Can you say behavior flag? (ug).
* test_nested_inner_contains_outer_boundary(), test_nested_with_same_boundary():Barry Warsaw2004-05-131-0/+36
| | | | Two evil samples from Anthony's MIME torture tests.
* _structure(): Make sure all output goes the to fp object.Barry Warsaw2004-05-131-2/+2
|
* Another evil test from Anthony's suite. This one has an inner part with theBarry Warsaw2004-05-131-0/+83
| | | | same boundary as the outer part.
* A boiled down example from Anthony's MIME torture tests. This one has aBarry Warsaw2004-05-131-0/+101
| | | | separating boundary for an outer part inside an inner part.
* Tests for message/external-body and for duplicate boundary lines.Barry Warsaw2004-05-111-3/+12
|
* More boiled down tests from Anthony's big torture suite.Barry Warsaw2004-05-111-2/+26
|
* A boiled down message/external-body example from Anthony's torture test.Barry Warsaw2004-05-111-0/+40
|
* An example with multiple boundary lines.Barry Warsaw2004-05-111-0/+22
|
* _parsegen(): Move the message/rfc822 clause to after theBarry Warsaw2004-05-111-12/+13
| | | | | | message/delivery-status clause, and genericize it to handle all (other) message/* content types. This lets us correctly parse 2 more of Anthony's MIME torture tests (specifically, the message/external-body examples).
* _parsegen(): Watch out for empty epilogues.Barry Warsaw2004-05-111-4/+5
|
* _parse_headers(): Strip a trailing newline from the envelope header. ClosesBarry Warsaw2004-05-101-0/+4
| | | | SF #951088.
* _split_ascii(): Small optimization by RH.Barry Warsaw2004-05-101-1/+1
|
* SF patch # 884030 by Amit Aronovitch; fixes the _subpart argument to matchBarry Warsaw2004-05-091-5/+7
| | | | documented semantics.
* test_mime_attachments_in_constructor(): New test to check for SF bug # 884030.Barry Warsaw2004-05-091-0/+9
|
* we dont support any Python's before 2.3 now.Barry Warsaw2004-05-092-139/+0
|
* Update to Python 2.3, getting rid of backward compatiblity crud.Barry Warsaw2004-05-095-84/+19
|
* Update to Python 2.3, getting rid of backward compatiblity crud.Barry Warsaw2004-05-091-281/+20
| | | | This Parser is now just a backward compatible front-end to the FeedParser.
* Update to Python 2.3, getting rid of backward compatiblity crud.Barry Warsaw2004-05-091-28/+17
|
* Update to Python 2.3, getting rid of backward compatiblity crud. We don'tBarry Warsaw2004-05-091-10/+52
| | | | need the _compat21 or _compat22 modules either.
* Update to Python 2.3, getting rid of backward compatiblity crud. Get rid of aBarry Warsaw2004-05-091-27/+6
| | | | bunch of module globals that aren't used.
* Update to Python 2.3, getting rid of backward compatiblity crud. Get rid of aBarry Warsaw2004-05-091-57/+29
| | | | | | | | | bunch of module globals that aren't used. __maxheaderlen -> _maxheaderlen _handle_multipart(): This should be more RFC compliant now, and does match the updated/fixed semantics for preamble and epilogue.
* An updated FeedParser that should be RFC complaint, passes all existingBarry Warsaw2004-05-091-289/+359
| | | | | | (standard) tests, and doesn't throw parse errors. I still need throw Anthony's torture test at it, but I wanted to get this checked in and off my disk.
* Add MessageDefect and subclasses.Barry Warsaw2004-05-091-4/+27
|