summaryrefslogtreecommitdiffstats
path: root/Lib/email
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* parse(), _parseheaders(), _parsebody(): A fix for SF bug #633527,Barry Warsaw2002-11-051-9/+22
| | | | | | | | | | | | | | | | | | where in lax parsing, the first non-header line after a header block (e.g. the first line not containing a colon, and not a continuation), can be treated as the first body line, even without the RFC mandated blank line separator. rfc822 had this behavior, and I vaguely remember problems with this, but can't remember details. In any event, all the tests still pass, so I guess we'll find out. ;/ This patch works by returning the non-header, non-continuation line from _parseheader() and using that as the first header line prepended to fp.read() if given. It's usually None. We use this approach instead of trying to seek/tell the file-like object.
* test_no_separating_blank_line(): A test for SF bug #633527, noBarry Warsaw2002-11-051-16/+36
| | | | | | separating blank line between a header block and body text. Tests both lax and strict parsing.
* A message with no separating blank line between the headers and theBarry Warsaw2002-11-051-0/+4
| | | | body. A test message for SF bug #633527.
* test_text_plain_in_a_multipart_digest(): A test of the fix for SF bugBarry Warsaw2002-11-051-0/+4
| | | | | #631350, where a subobject in a multipart/digest isn't a message/rfc822.
* _parsebody(): A fix for SF bug #631350, where a subobject in aBarry Warsaw2002-11-051-2/+6
| | | | | | | | | | multipart/digest isn't a message/rfc822. This is legal, but counter to recommended practice in RFC 2046, $5.1.5. The fix is to look at the content type after setting the default content type. If the maintype is then message or multipart, attach the parsed subobject, otherwise use set_payload() to set the data of the other object.
* Test case, distilled from SF bug #631350, where a subobject in aBarry Warsaw2002-11-051-0/+19
| | | | | multipart/digest isn't a message/rfc822. This is legal, but counter to recommended practice in RFC 2046, $5.1.5.
* Bump __version__ (yes, to 2.5 "minus")Barry Warsaw2002-11-051-1/+1
|
* Jason Mastaler's patch to break the dependence on rfc822.py for theBarry Warsaw2002-11-052-5/+446
| | | | address parsing routines. Closes SF patch #613434.
* test_body_encoding(): a new test for Charset.body_encode(), especiallyBarry Warsaw2002-10-211-0/+14
| | | | one that tests the obscure bug reported in SF # 625509.
* test_body_encoding(): a new testBarry Warsaw2002-10-211-0/+23
|
* body_encode(): Fixed typo reported by Chris Lawrence, closing SF bugBarry Warsaw2002-10-211-1/+1
| | | | | | #625509. This isn't a huge problem because at the moment there are no built-in charsets for which header_encoding is QP but body_encoding is not.
* append(): Fixing the test for convertability after consultation withBarry Warsaw2002-10-141-14/+28
| | | | | | | Ben. If s is a byte string, make sure it can be converted to unicode with the input codec, and from unicode with the output codec, or raise a UnicodeError exception early. Skip this test (and the unicode->byte string conversion) when the charset is our faux 8bit raw charset.
* Two new tests for splitting (or not splitting) 8-bit header data.Barry Warsaw2002-10-141-0/+21
|
* Bump the __version__Barry Warsaw2002-10-141-1/+1
|
* __init__(): Fix an invariant, that the charset item in a chunk tupleBarry Warsaw2002-10-141-2/+11
| | | | | | | | | | must be a Charset instance, not a string. The bug here was that self._charset wasn't being converted to a Charset instance so later .append() calls which used the default charset would break. _split(): If the charset of the chunk is '8bit', return the chunk unchanged. We can't safely split it, so this is the avenue of least harm.
* _split_header(): If we have a header which is a byte string containingBarry Warsaw2002-10-141-1/+17
| | | | | | | | | 8-bit data, we cannot split it safely, so return the original string unchanged. _is8bitstring(): Helper function which returns True when we have a byte string that contains non-ascii characters (i.e. mysterious 8-bit data).
* CHARSETS: Add faux '8bit' encoding for representing raw 8-bit data forBarry Warsaw2002-10-141-0/+2
| | | | which we know nothing else.
* _encode_chunks(), encode(): Don't modify self._chunks. As Ben says:Barry Warsaw2002-10-131-23/+22
| | | | | | | | | Also, it fixes a really egregious error in Header.encode() (really in Header._encode_chunks()) that could cause a header to grow and grow each time encode() was called if output_codec was different from input_codec. Also, fix a typo.
* Update the urls and other information about the add-on Japanese,Barry Warsaw2002-10-131-13/+8
| | | | Korean, and Chinese codecs.
* Bump version number to 2.4.2 to pick up the latest minor bug fixes.Barry Warsaw2002-10-101-1/+1
|
* New tests to verify that charsets are case insensitive, and that byBarry Warsaw2002-10-101-0/+34
| | | | default get_body_encoding() cannot be SHORTEST.
* get_content_charset(): RFC 2046 $4.1.2 says charsets are not caseBarry Warsaw2002-10-101-4/+6
| | | | sensitive. Coerce the argument to lower case.
* __init__(): RFC 2046 $4.1.2 says charsets are not case sensitive.Barry Warsaw2002-10-101-1/+3
| | | | | Coerce the argument to lower case. Also, since body encodings can't be SHORTEST, default the CHARSETS failobj's second item to BASE64.
* openfile(): Go back to opening the files in text mode. This undoesBarry Warsaw2002-10-072-2/+2
| | | | | | the change in revision 1.11 (test_email.py) in response to SF bug #609988. We now think that was the wrong fix and that WinZip was the real culprit there.
* _parsebody(): Use get_content_type() instead of the deprecatedBarry Warsaw2002-10-071-5/+6
| | | | | | | get_type(). Also, one of the regular expressions is constant so might as well make it a module global. And, when splitting up digests, handle lineseps that are longer than 1 character in length (e.g. \r\n).
* Bump the version to 2.4.1 (not 2.5 as previously mentioned) to sync itBarry Warsaw2002-10-071-1/+1
| | | | with the standalone mimelib package.
* test__all__(): Fix the import list.Barry Warsaw2002-10-011-4/+4
|
* Docstring consistency with the updated .tex files.Barry Warsaw2002-10-011-3/+3
|
* _structure(): Swap fp and level arguments.Barry Warsaw2002-10-011-2/+2
|
* Docstring consistency with the updated .tex files.Barry Warsaw2002-10-011-6/+15
|
* Docstring consistency with the updated .tex files.Barry Warsaw2002-10-012-17/+17
|
* Docstring consistency with the updated .tex files.Barry Warsaw2002-09-301-3/+4
|
* Docstring consistency with the updated .tex files.Barry Warsaw2002-09-301-3/+3
|
* Docstring consistency with the updated .tex files.Barry Warsaw2002-09-301-3/+3
|
* Docstring consistency with the updated .tex files.Barry Warsaw2002-09-301-3/+3
|
* __all__: UpdatedBarry Warsaw2002-09-301-20/+22
|