summaryrefslogtreecommitdiffstats
path: root/Lib/email
Commit message (Collapse)AuthorAgeFilesLines
* Adjust tests for no newline appending to MIMEText.__init__()'s _textBarry Warsaw2003-03-111-11/+7
| | | | argument.
* __init__(): Don't add a newline to _text if it doesn't already end inBarry Warsaw2003-03-111-4/+1
| | | | one. Possibly controversial.
* body_line_iterator(): Accept optional decode argument, pass through toBarry Warsaw2003-03-112-6/+12
| | | | Message.get_payload().
* get_payload(): Teach this about various uunencodedBarry Warsaw2003-03-111-10/+21
| | | | Content-Transfer-Encodings
* test_get_decoded_uu_payload(): A new test forBarry Warsaw2003-03-111-0/+11
| | | | Content-Transfer-Encoding: x-uuencode
* specialsre, escapesre: In SF bug #663369, Matthew Woodcraft points outBarry Warsaw2003-03-101-2/+2
| | | | that backslashes must be escaped in character sets.
* test_escape_backslashes(): A test for SF bug #663369 by Matthew Woodcraft.Barry Warsaw2003-03-101-0/+8
|
* _bdecode(): Remove redundant check.Barry Warsaw2003-03-101-2/+0
|
* Fix base classBarry Warsaw2003-03-101-1/+1
|
* Use ndiffAssertEqual in a couple of places for better error reporting.Barry Warsaw2003-03-101-3/+6
|
* get_payload(): If we get a low-level binascii.Error when base64Barry Warsaw2003-03-101-5/+12
| | | | decoding the payload, just return it as-is.
* test_broken_base64_payload(): Test for crash in low-level binasciiBarry Warsaw2003-03-101-0/+8
| | | | module when decoding a message with broken base64.
* _split_ascii() [method and function]: Don't join the lines just toBarry Warsaw2003-03-101-10/+11
| | | | | | split them again. Simply return them as chunk lists. _encode_chunks(): Don't add more folding whitespace than necessary.
* test_another_long_multiline_header(): Yet another formatting test.Barry Warsaw2003-03-101-0/+12
|
* _split_ascii(): lstrip the individual lines in the ascii split lines,Barry Warsaw2003-03-071-0/+3
| | | | since we'll be adding our own continuation whitespace later.
* test_long_unbreakable_lines_with_continuation(): Another funky exampleBarry Warsaw2003-03-071-0/+16
| | | | from Jason Mastaler :)
* decode_rfc2231(): RFC 2231 allows leaving out both the charset andBarry Warsaw2003-03-071-5/+7
| | | | language without including any single quotes.
* test_rfc2231_no_language_or_charset(): RFC 2231 allows leaving outBarry Warsaw2003-03-071-0/+11
| | | | both the charset and language without including any single quotes.
* whitespace normalizationBarry Warsaw2003-03-071-6/+6
|
* _write_headers(), _split_header(): All of the smarts for splittingBarry Warsaw2003-03-071-35/+20
| | | | | | long header lines is now (properly) in the Header class. So we no longer need _split_header() and we'll just defer to Header.encode() when we have a plain string.
* More internal refinements of the ascii splitting algorithm.Barry Warsaw2003-03-071-7/+10
| | | | | | | | | | | | | | _encode_chunks(): Pass maxlinelen in instead of always using self._maxlinelen, so we can adjust for shorter initial lines. Pass this value through to _max_append(). encode(): Weave maxlinelen through to the _encode_chunks() call. _split_ascii(): When recursively splitting a line on spaces (i.e. lower level syntactic split), don't append the whole returned string. Instead, split it on linejoiners and extend the lines up to the last line (for proper packing). Calculate the linelen based on the last element in the this list.
* test_string_headerinst_eq(): Another Jason test :)Barry Warsaw2003-03-071-0/+14
|
* Repaired a misleading comment Barry inherited from me.Tim Peters2003-03-061-1/+1
|
* _split_ascii(): In the clause where curlen + partlen > maxlen, if theBarry Warsaw2003-03-061-1/+8
| | | | | | part itself is longer than maxlen, and we aren't already splitting on whitespace, then we recursively split the part on whitespace and append that to the this list.
* test_long_received_header(): Another test case for folding longBarry Warsaw2003-03-061-0/+15
| | | | | Received headers (first on semis then on whitespace), given by Jason Mastaler.
* test_whitespace_eater_unicode(): Test of the last outstanding bug inBarry Warsaw2003-03-061-0/+8
| | | | SF # 640110.
* __unicode__(): When converting to a unicode string, we need toBarry Warsaw2003-03-061-3/+20
| | | | | | preserve spaces in the encoded/unencoded word boundaries. RFC 2047 is ambiguous here, but most people expect the space to be preserved. Really closes SF bug # 640110.
* test_rfc2047_multiline(): Test case for SF bug #640110.Barry Warsaw2003-03-061-0/+14
|
* decode_header(): Typo when appending an unencoded chunk to theBarry Warsaw2003-03-061-1/+1
| | | | | | previous unencoded chunk (e.g. when they appear on separate lines). Closes the 2nd bug in SF #640110 (the first one's already been fixed).
* Merge of the folding-reimpl-branch. Specific changes,Barry Warsaw2003-03-062-76/+165
| | | | Update tests for email 2.5.
* Merge of the folding-reimpl-branch. Specific changes,Barry Warsaw2003-03-061-100/+154
| | | | | | | | | | | | | | | | | | | | | | | _split(): New implementation of ASCII line splitting which should do a better job and not be subject to the various weird artifacts (bugs) reported. This should also do a better job of higher-level syntactic splits by trying first to split on semis, then commas, then whitespace. Use a Timbot-ly binary search for optimal non-ASCII split points for better packing of header lines. This also lets us remove one recursion call. Don't pass in firstline, but instead pass in the actual line length we're shooting for. Also pass in the list of split characters. encode(): Pass in the list of split characters so applications can have some control over what "higher level syntactic breaks" are. Also, decode_header(): Transform binascii.Errors which can occur when decoding a base64 RFC 2047 header with bogus data, into an email.Errors.HeaderParseError. Closes SF bug #696712.
* Merge of the folding-reimpl-branch. Specific changes,Barry Warsaw2003-03-061-2/+2
| | | | Rename a constant.
* Merge of the folding-reimpl-branch. Specific changes,Barry Warsaw2003-03-061-3/+0
| | | | Remove a senseless comment.
* Merge of the folding-reimpl-branch. Specific changes,Barry Warsaw2003-03-061-2/+13
| | | | | | | | | | _handle_multipart(): Ensure that if the preamble exists but does not end in a newline, a newline is still added. Without this, the boundary separator will end up on the preamble line, breaking the MIME structure. _make_boundary(): Handle differences in the decimal point character based on the locale.
* Merge of the folding-reimpl-branch. Specific changes,Barry Warsaw2003-03-061-2/+4
| | | | | | | | Charset: Alias __repr__ to __str__ for debugging. header_encode(): When calling quopriMIME.header_encode(), set maxlinelen=None so that the lower level function doesn't (also) try to wrap/fold the line.
* Merge of the folding-reimpl-branch. Specific changes,Barry Warsaw2003-03-061-4/+9
| | | | | | | | | | | _max_append(): Change the comparison so that the new string is concatenated if it's less than or equal to the max length. header_encode(): Allow for maxlinelen == None to mean, don't do any line splitting. This is because this module is mostly used by higher level abstractions (Header.py) which already ensures line lengths. We do this in a cheapo way by setting the max_encoding to some insanely <100k wink> large number.
* CHARSETS, ALIASES, CODEC_MAP: SF feature request 633543, KoreanBarry Warsaw2003-01-071-0/+37
| | | | | | | | | support and other charset defaults. See also: http://article.gmane.org/gmane.comp.python.mime.devel/250 (this just commits the last bit of the article that wasn't part of email 2.4.3.)
* Jack complained that on test_crlf_separation() was failing on MacOS9Barry Warsaw2003-01-021-4/+4
| | | | | | | | | | | | because the test file, msg_26.txt which has \r\n line endings, was getting munged by cvs, which knows to do line ending conversions for text files. But we want \r\n to be preserved on all platforms, so we cvs admin'd the file to be -kb (binary), which means we have to open the file in binary mode to preserve these line ends. Hopefully this will be the end of the thrashing on this issue (but probably not). Test passes on *nix now, and Tim confirms it passes on Windows. We'll leave it to Jack to test MacOS.
* test_bad_8bit_header(): Tests for optional argument `errors'. See SFBarry Warsaw2002-12-301-0/+11
| | | | bug #648119.
* Header.__init__(), .append(): Add an optional argument `errors' whichBarry Warsaw2002-12-301-6/+11
| | | | | | is passed straight through to the unicode() and ustr.encode() calls. I think it's the best we can do to address the UnicodeErrors in badly encoded headers such as is described in SF bug #648119.
* Actually, make this 2.5a1 since it will include API changes that mayBarry Warsaw2002-12-301-1/+1
| | | | need more vetting, and it will be included in Python 2.3a1.
* Bump to 2.5Barry Warsaw2002-12-301-1/+1
|
* TestMIMEAudio.setUp(): Use the email package's copy of the audio testBarry Warsaw2002-12-301-2/+7
| | | | | | file, needed because some binary distros (read RPMs) don't include the test module in their standard Python package. This eliminates an external dependency and closes SF bug # 650441.
* A copy of the audio test file from Lib/test, needed because someBarry Warsaw2002-12-301-0/+0
| | | | | | binary distros (read RPMs) don't include the test module in their standard Python package. This eliminates an external dependency and closes SF bug # 650441.
* parsedate_tz(): Fix SF bug #552345, optional FWS between the comma andBarry Warsaw2002-12-301-1/+8
| | | | the day in an RFC 2822 date.
* test_parsedate_compact(): A test for optional FWS between the commaBarry Warsaw2002-12-301-0/+5
| | | | | and the day number in an RFC 2822 date specification. See bug #552345.
* A code cleansing passBarry Warsaw2002-12-301-55/+74
|
* Port rfc822.py changes that didn't make it into this copy,Barry Warsaw2002-12-301-21/+35
| | | | | specifically that dots are allowed in obs-phrase. This fixes parsing of dots in realnames.
* test_name_with_dots(): A new test to ensure that we're implementingBarry Warsaw2002-12-301-0/+9
| | | | RFC 2822's rules w.r.t. dots in the realname part of address fields.
* Whitespace normalization.Tim Peters2002-12-241-1/+1
|