summaryrefslogtreecommitdiffstats
path: root/Lib/email
Commit message (Collapse)AuthorAgeFilesLines
* Patch #2167 from calvin: Remove unused importsChristian Heimes2008-02-232-2/+0
|
* Fix issue #1822: MIMEMultipart.is_multipart() behaves correctly for aFacundo Batista2008-01-192-0/+9
| | | | | just-created (and empty) instance. Added tests for this. Thanks Jonathan Share.
* In response to this SF bug:Barry Warsaw2007-07-132-0/+23
| | | | | | | | | | [ 1752723 ] email.message_from_string: initial line gets discarded I added a test to assert that when the first line of text passed to message_from_string() contains a leading space, the message ends up with the appropriate FirstHeaderLineIsContinuationDefect on its defects list. The bug is invalid.
* SF bug #1582282; decode_header() incorrectly splits not-conformant RFCBarry Warsaw2007-03-143-1/+26
| | | | | | | 2047-like headers where there is no whitespace between encoded words. This fix changes the matching regexp to include a trailing lookahead assertion that the closing ?= must be followed by whitespace, newline, or end-of-string. This also changes the regexp to add the MULTILINE flag.
* Patch #1449244: Support Unicode strings inMartin v. Löwis2007-03-132-2/+11
| | | | | email.message.Message.{set_charset,get_content_charset}. Will backport.
* Tokio Kikuchi's fix for SF bug #1629369; folding whitespace allowed in theBarry Warsaw2007-03-123-4/+17
| | | | | | | | | display name of an email address, e.g. Foo \tBar <foo@example.com> Test case added by Barry.
* Patch #1634778: add missing encoding aliases for iso8859_15 andGeorg Brandl2007-01-271-0/+3
| | | | iso8859_16.
* decode_rfc2231(): As Christian Robottom Reis points out, it makes no sense toBarry Warsaw2006-10-041-4/+0
| | | | test for parts > 3 when we use .split(..., 2).
* Forward port some fixes that were in email 2.5 but for some reason didn't makeBarry Warsaw2006-07-263-1/+100
| | | | | | | it into email 4.0. Specifically, in Message.get_content_charset(), handle RFC 2231 headers that contain an encoding not known to Python, or a character in the data that isn't in the charset encoding. Also forward port the appropriate unit tests.
* More RFC 2231 improvements for the email 4.0 package. As Mark Sapiro rightlyBarry Warsaw2006-07-213-41/+277
| | | | | | | | | | | | | | | | | | | | | | | | points out there are really two types of continued headers defined in this RFC (i.e. "encoded" parameters with the form "name*0*=" and unencoded parameters with the form "name*0="), but we were were handling them both the same way and that isn't correct. This patch should be much more RFC compliant in that only encoded params are %-decoded and the charset/language information is only extract if there are any encoded params in the segments. If there are no encoded params then the RFC says that there will be no charset/language parts. Note however that this will change the return value for Message.get_param() in some cases. For example, whereas before if you had all unencoded param continuations you would have still gotten a 3-tuple back from this method (with charset and language == None), you will now get just a string. I don't believe this is a backward incompatible change though because the documentation for this method already indicates that either return value is possible and that you must do an isinstance(val, tuple) check to discriminate between the two. (Yeah that API kind of sucks but we can't change /that/ without breaking code.) Test cases, some documentation updates, and a NEWS item accompany this patch.
* decode_rfc2231(): Be more robust against buggy RFC 2231 encodings.Barry Warsaw2006-07-173-4/+43
| | | | | | | | | | | | | | | | | Specifically, instead of raising a ValueError when there is a single tick in the parameter, simply return that the entire string unquoted, with None for both the charset and the language. Also, if there are more than 2 ticks in the parameter, interpret the first three parts as the standard RFC 2231 parts, then the rest of the parts as the encoded string. Test cases added. Original fewer-than-3-parts fix by Tokio Kikuchi. Resolves SF bug # 1218081. I will back port the fix and tests to Python 2.4 (email 3.0) and Python 2.3 (email 2.5). Also, bump the version number to email 4.0.1, removing the 'alpha' moniker.
* Port forward from 2.4 branch:Barry Warsaw2006-05-013-0/+13
| | | | | | | | | | Patch #1464708 from William McVey: fixed handling of nested comments in mail addresses. E.g. "Foo ((Foo Bar)) <foo@example.com>" Fixes for both rfc822.py and email package. This patch needs to be back ported to Python 2.3 for email 2.5.
* The email module's parsedate_tz function now sets the daylight savingsAnthony Baxter2006-04-033-5/+6
| | | | | | flag to -1 (unknown) since it can't tell from the date whether it should be set. patch from Aldo Cortesi
* whitespace n11nAnthony Baxter2006-03-201-8/+8
|
* Merge email package 4.0 from the sandbox, including documentation, test cases,Barry Warsaw2006-03-1827-202/+3562
| | | | and NEWS updates.
* Actually this file should have svn:eol-style CRLF since it's specificallyBarry Warsaw2006-03-041-45/+45
| | | | testing line ending compatibility.
* Set eol-style to native -- doesn't appear to be any reasonTim Peters2006-03-041-45/+45
| | | | for it to claim it has mime-type application/octet-stream.
* Port relevant patches for SF 1409455 to the trunk for email 3.0/Python 2.5.Barry Warsaw2006-02-085-8/+20
| | | | Will port to Python 2.4.
* Resolves SF bug #1423972.Barry Warsaw2006-02-041-2/+4
|
* parsedate_tz(): Minor cleanup.Barry Warsaw2006-02-032-3/+11
| | | | | Port from Python 2.3/email 2.5: Add a test for the tm_yday field is 1 in the return of parsedate().
* 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.