Commit Graph

88 Commits

Author SHA1 Message Date
Martin Panter
b44c4520d9 Issue #27125: Fix various errors like “will [be] inherited” 2016-05-29 08:13:58 +00:00
Benjamin Peterson
bfd976fc17 simply ignore headers with no name (#19996)
Patch by Cory Benfield.
2015-01-25 23:34:42 -05:00
Ezio Melotti
003014bf1e #15980: properly escape newlines in docstrings. Patch by Serhiy Storchaka. 2012-09-21 16:27:45 +03:00
Ezio Melotti
1e87da16ea Remove duplication. 2011-10-19 10:39:35 +03:00
Benjamin Peterson
a6864e0d9f fix test_py3kwarns
The fact that this was failing and went unnoticed so long seems like a good argument for being able to enable and disble py3kwarnings through Python.
2008-07-14 17:42:17 +00:00
Benjamin Peterson
26305a03e3 add py3k warnings to rfc822 2008-06-12 22:33:06 +00:00
Georg Brandl
626349526e Bug #1249573: fix rfc822.parsedate not accepting a certain date format 2007-01-22 21:10:33 +00:00
Barry Warsaw
dbcc8d9b24 Port forward from 2.4 branch:
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.
2006-05-01 03:03:02 +00:00
Raymond Hettinger
508e81eda0 Convert splitlines to for-loop (handles case where input does not have a trailing newline). 2005-02-08 15:39:11 +00:00
Raymond Hettinger
bb5fbc4af9 Wholistic code cleanup / modernization:
* Use +=
* Replace loop logic with str.splitlines equivalent
* Don't use variable names that shadow tuple, list, and str
* Use dict.get instead of equivalent try/except
* Minor loop logic simplications
2005-02-08 08:05:13 +00:00
Raymond Hettinger
ce96d8b684 Bug #1030125: rfc822 __iter__ problem
Add iteration support to the Message class.
2004-09-22 17:17:32 +00:00
Barry Warsaw
e8bedeb45b Resolution of bug #997368, "strftime() backward compatibility".
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
2004-08-07 16:38:40 +00:00
Neil Schemenauer
767126d7b9 Make Message.__str__ more efficient. 2003-11-11 19:39:17 +00:00
Raymond Hettinger
85c20a41df Implement and apply PEP 322, reverse iteration 2003-11-06 14:06:48 +00:00
Barry Warsaw
4e09d5c6d6 unquote(): Didn't properly de-backslash-ify. This patch (adapted from
Quinn Dunkan's mimelib SF patch #573204) fixes the problem.
2002-09-11 02:32:14 +00:00
Tim Peters
c411dbaeee Whitespace normalization. 2002-07-16 21:35:23 +00:00
Guido van Rossum
d842e07470 SF bug 558179.
Change default for get() back to None.
Will backport to 2.2.1.
2002-06-05 19:07:39 +00:00
Raymond Hettinger
54f0222547 SF 563203. Replaced 'has_key()' with 'in'. 2002-06-01 14:18:47 +00:00
Barry Warsaw
f655328483 parseaddr(): Fixed in the same way that Message.getaddrlist() was
fixed (re: SF bug #555035).  Include a unittest.
2002-05-23 03:21:01 +00:00
Barry Warsaw
0a8d4d5736 Message.getaddrlist(): Use the AddressList.addresslist attribute
instead of calling the getaddrlist() method, since the latter doesn't
work with multiple calls (it will return the empty list for the second
and subsequent calls).

Closes SF bug #555035.  Include a unittest.
2002-05-21 19:46:13 +00:00
Barry Warsaw
56cdf11922 AddrlistClass -> AddressList 2002-04-12 20:55:31 +00:00
Guido van Rossum
8ca162f417 Partial introduction of bools where appropriate. 2002-04-07 06:36:23 +00:00
Guido van Rossum
f830a52996 SF patch #495358 (Artur Zaprzala): rfc822.AddressList and "<>" address
rfc822.AddressList incorrectly handles empty address.
    "<>" is converted to None and should be "".
    AddressList.__str__() fails on None.
    I got an email with such an address and my program
    failed processing it.

    Example:
    >>> import rfc822

    >>> rfc822.AddressList("<>").addresslist
    [('', None)]
    >>> str(rfc822.AddressList("<>"))
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "/usr/lib/python2.1/rfc822.py", line 753, in __str__
    return ", ".join(map(dump_address_pair,
    self.addresslist))
    TypeError: sequence item 0: expected string, None found

[His solution: in the internal routine AddrlistClass.getrouteaddr(),
initialize adlist to "".]
2001-12-20 15:54:48 +00:00
Barry Warsaw
f1fd282f13 Fix for bug #481221, getaddrlist() failing on long addresses. 2001-11-13 21:30:37 +00:00
Barry Warsaw
4a106ee9e1 parsedate_tz(): If data is false, return None. Fixes bug #478115,
IndexError when a Date: field exists with an empty value.
2001-11-13 18:00:40 +00:00