summaryrefslogtreecommitdiffstats
path: root/Lib/email
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Docstring consistency with the updated .tex files.Barry Warsaw2002-09-301-0/+14
|
* __contains__(): Change the second argument to `name' for consistency.Barry Warsaw2002-09-301-58/+69
| | | | | | I seriously doubt this will break any deployed code. Docstring consistency with the updated .tex files.
* With help from Martin v. Loewis, clarification is added for theBarry Warsaw2002-09-301-29/+61
| | | | | | | | | | | | | | | | | | | | semantics of header chunks using byte and Unicode strings. Specifically, append(): When the given string is a byte string, charset (whether specified explicitly in the argument list or implicitly via the constructor default) is the encoding of the byte string, and a UnicodeError will be raised if the string cannot be decoded with that charset. If s is a Unicode string, then charset is a hint specifying the character set of the characters in the string. In this case, when producing an RFC 2822 compliant header using RFC 2047 rules, the Unicode string will be encoded using the following charsets in order: us-ascii, the charset hint, utf-8. __init__(): Use the global USASCII Charset instance when the charset argument is None. Also, clarification in the docstring. Also, use True/False where appropriate.
* The ansi_x3.4_1968 encoding is an alias for ascii, but isn't known inBarry Warsaw2002-09-302-12/+9
| | | | | | | | Python 2.1.3. However it's required by the email tests suite, so poke it into the encodings aliases if it's missing. The is apparently the approved API for doing so. Now we can remove the hexversion shortcircuits in the test suite.
* Make the tests pass under Python 2.1 but only by cheating. Python 2.1Barry Warsaw2002-09-281-0/+12
| | | | | doesn't know about the ansi-x3.4-1968 charset so skip two tests that rely on that (msg_32.txt and msg_33.txt).
* Add a test for SHORTEST encoding of utf-8 headers, and also updateBarry Warsaw2002-09-281-9/+16
| | | | some of the test values which change because of this.
* Use True/False everywhere, and other code cleanups.Barry Warsaw2002-09-282-18/+30
|
* Code cleanup and add docstrings.Barry Warsaw2002-09-281-2/+17
|
* Use True/False everywhere, and other code cleanups.Barry Warsaw2002-09-281-7/+11
|
* Use True/False everywhere.Barry Warsaw2002-09-281-5/+12
|
* is_multipart(): Use isinstance() instead of type equality.Barry Warsaw2002-09-281-1/+1
|
* Docstring and code cleanups, e.g. use True/False everywhere.Barry Warsaw2002-09-281-58/+62
|
* __init__(): Minor code cleanup.Barry Warsaw2002-09-281-1/+1
|
* Add a pychecker suppression.Barry Warsaw2002-09-281-0/+4
|
* Use True/False everywhere.Barry Warsaw2002-09-281-20/+19
|
* Added a feature suggested by Martin v Loewis, where a new headerBarry Warsaw2002-09-281-37/+55
| | | | | | | | | | | | | encoding flag SHORTEST means to return the shortest encoding between base64 and qp. This is used for the header_enc for utf-8. SHORTEST isn't legal for body_enc. Also some code cleanup: - use True/False everywhere - use == instead of `is' in a few places - added _unicode() and make consistent the "is unicode" checks - update docstrings
* test_unicode_error(): Comment this test out, since we still haveBarry Warsaw2002-09-261-8/+8
| | | | controversy.
* Fixing some RFC 2231 related issues as reported in the SpambayesBarry Warsaw2002-09-263-0/+66
| | | | | | | project, and with assistance from Oleg Broytmann. Specifically, added some new tests to make sure we handle RFC 2231 encoded parameters correctly. Two new data files were added which contain RFC 2231 encoded parameters.
* Fixing some RFC 2231 related issues as reported in the SpambayesBarry Warsaw2002-09-261-9/+39
| | | | | | | | | | | | | | | | | | | | | project, and with assistance from Oleg Broytmann. Specifically, get_param(), get_params(): Document that these methods may return parameter values that are either strings, or 3-tuples in the case of RFC 2231 encoded parameters. The application should be prepared to deal with such return values. get_boundary(): Be prepared to deal with RFC 2231 encoded boundary parameters. It makes little sense to have boundaries that are anything but ascii, so if we get back a 3-tuple from get_param() we will decode it into ascii and let any failures percolate up. get_content_charset(): New method which treats the charset parameter just like the boundary parameter in get_boundary(). Note that "get_charset()" was already taken to return the default Charset object. get_charsets(): Rewrite to use get_content_charset().
* __version__: Bump to 2.4Barry Warsaw2002-09-251-9/+16
| | | | | | | | | | | Move the imports of Parser and Message inside the message_from_string() and message_from_file() functions. This way just "import email" won't suck in most of the submodules of the package. Note: this will break code that relied on "import email" giving you a bunch of the submodules, but that was never documented and should not have been relied on.
* Open the test files in binary mode so the \r\n files won't causeBarry Warsaw2002-09-182-3/+3
| | | | failures on Windows. Closes SF bug # 609988.
* Bump to 2.3.1 to pick up the missing file.Barry Warsaw2002-09-121-1/+1
|
* get_payload(): Document that calling it with no arguments returns aBarry Warsaw2002-09-111-2/+3
| | | | reference to the payload.
* test_utils_quote_unquote(): Test for unquote() properlyBarry Warsaw2002-09-111-0/+7
| | | | de-backslash-ifying.
* rfc822.unquote() doesn't properly de-backslash-ify in Python prior toBarry Warsaw2002-09-111-1/+12
| | | | | 2.3. This patch (adapted from Quinn Dunkan's SF patch #573204) fixes the problem and should get ported to rfc822.py.
* _parsebody(): Instead of raising a BoundaryError when no startBarry Warsaw2002-09-101-2/+5
| | | | | boundary could be found -- in a lax parser -- the entire body is assigned to the message payload.
* Import _isstring() from the compatibility layer.Barry Warsaw2002-09-101-2/+12
| | | | | | | | | | | _handle_text(): Use _isstring() for stringiness test. _handle_multipart(): Add a test before the ListType test, checking for stringiness of the payload. String payloads for multitypes means a message with broken MIME chrome was parsed by a lax parser. Instead of raising a BoundaryError in those cases, the entire body is assigned to the message payload (but since the content type is still multipart/*, the Generator needs to be updated too).
* _isstring(): Factor out "stringiness" test, e.g. for StringType orBarry Warsaw2002-09-102-2/+10
| | | | UnicodeType, which is different between Python 2.1 and 2.2.
* _ascii_split(): Don't lstrip continuation lines. Closes SF bug #601392.Barry Warsaw2002-09-101-1/+1
|
* test_splitting_first_line_only_is_long(): New test for SF bug #601392,Barry Warsaw2002-09-101-1/+38
| | | | broken wrapping of long ASCII headers.
* A sample message with broken MIME boundaries.Barry Warsaw2002-09-101-0/+15
|
* test_set_param(), test_del_param(): Test RFC 2231 encoding support byBarry Warsaw2002-09-061-1/+68
| | | | Oleg Broytmann in SF patch #600096. Whitespace normalized by Barry.
* _formatparam(), set_param(): RFC 2231 encoding support by OlegBarry Warsaw2002-09-061-3/+11
| | | | | | Broytmann in SF patch #600096. Specifically, the former function now encodes the triplets, while the latter adds optional charset and language arguments.
* test_mondo_message(): "binary" is not a legal content type, so withBarry Warsaw2002-09-061-2/+3
| | | | | the previous RFC 2045, $5.2 repair to get_content_type() this subpart's type will now be text/plain.
* test_replace_header(): New test for Message.replace_header().Barry Warsaw2002-09-061-0/+17
|
* replace_header(): New method given by Skip Montanaro in SF patchBarry Warsaw2002-09-061-1/+15
| | | | | #601959. Modified slightly by Barry (who added the KeyError in case the header is missing.
* _structure(): Use .get_content_type()Barry Warsaw2002-09-011-1/+1
|
* Whitespace normalization.Barry Warsaw2002-08-271-1/+1
|
* TypoBarry Warsaw2002-08-271-1/+1
|
* Whitespace normalization.Tim Peters2002-08-233-9/+9
|
* Bump version number to 2.3Barry Warsaw2002-08-201-1/+1
|
* Added tests for SF patch #597593, syntactically invalid Content-Type: headers.Barry Warsaw2002-08-201-2/+23
|
* get_content_type(), get_content_maintype(), get_content_subtype(): RFCBarry Warsaw2002-08-201-5/+5
| | | | | | | | | | | 2045, section 5.2 states that if the Content-Type: header is syntactically invalid, the default type should be text/plain. Implement minimal sanity checking of the header -- it must have exactly one slash in it. This closes SF patch #597593 by Skip, but in a different way. Note that these methods used to raise ValueError for invalid ctypes, but now they won't.
* _dispatch(): Use get_content_maintype() and get_content_subtype() toBarry Warsaw2002-08-201-3/+2
| | | | | | get the MIME main and sub types, instead of getting the whole ctype and splitting it here. The two more specific methods now correctly implement RFC 2045, section 5.2.
* test_three_lines(): Test case reported by Andrew McNamara. Works inBarry Warsaw2002-08-201-0/+8
| | | | email 2.2 but fails in email 1.0.