Commit Graph

29 Commits

Author SHA1 Message Date
Tim Peters e718f615b8 Whitespace normalization. 2004-10-12 21:51:32 +00:00
Anthony Baxter 3dd9e46161 Added a usegmt flag to email.Utils.formatdate - this allows it to be
used to replace rfc822.formatdate for protocols like HTTP (where 'GMT' must
be the timezone string).
2004-10-11 13:53:08 +00:00
Barry Warsaw bb11386730 Big email 3.0 API changes, with updated unit tests and documentation.
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.
2004-10-03 03:16:19 +00:00
Barry Warsaw 24f79762a1 Update to Python 2.3, getting rid of backward compatiblity crud. 2004-05-09 03:55:11 +00:00
Barry Warsaw 0b6f0d8810 decode_rfc2231(): We need to urllib.unquote() the value even if the
charset and language fields are not present, e.g. as in:

    title*0="This%20is%20encoded"
2003-08-19 03:49:34 +00:00
Barry Warsaw a2369928b5 specialsre, escapesre: In SF bug #663369, Matthew Woodcraft points out
that backslashes must be escaped in character sets.
2003-03-10 19:20:18 +00:00
Barry Warsaw 59e98ae1c5 _bdecode(): Remove redundant check. 2003-03-10 17:36:04 +00:00
Barry Warsaw 8e1e7f5468 decode_rfc2231(): RFC 2231 allows leaving out both the charset and
language without including any single quotes.
2003-03-07 22:46:41 +00:00
Barry Warsaw 030ddf794f Jason Mastaler's patch to break the dependence on rfc822.py for the
address parsing routines.  Closes SF patch #613434.
2002-11-05 19:54:52 +00:00
Barry Warsaw 0ebc5c96c5 Docstring consistency with the updated .tex files. 2002-10-01 00:44:13 +00:00
Barry Warsaw 5bdb2bee37 Use True/False everywhere, and other code cleanups. 2002-09-28 20:49:57 +00:00
Barry Warsaw 184d55a897 rfc822.unquote() doesn't properly de-backslash-ify in Python prior to
2.3.  This patch (adapted from Quinn Dunkan's SF patch #573204) fixes
the problem and should get ported to rfc822.py.
2002-09-11 02:22:48 +00:00
Barry Warsaw 12566a8826 Oleg Broytmann's support for RFC 2231 encoded parameters, SF patch #549133
Specifically,

decode_rfc2231(), encode_rfc2231(): Functions to encode and decode RFC
2231 style parameters.

decode_params(): Function to decode a list of parameters.
2002-06-29 05:58:04 +00:00
Barry Warsaw 21f77ac0bc Use absolute import paths for intrapackage imports. 2002-06-02 19:07:16 +00:00
Tim Peters 8ac1495a6a Whitespace normalization. 2002-05-23 15:15:30 +00:00
Barry Warsaw 4be9eccbc4 getaddresses(): Like the change in rfc822.py, this one needs to access
the AddressList.addresslist attribute directly.

Also, add a test case for the email.Utils.getaddresses() interface.
2002-05-22 01:52:10 +00:00
Barry Warsaw 8c1aac2476 Complete a merge of the mimelib project and the Python cvs codebases
for the email package.  The former is now just a shell project that
has some extra files for packaging for independent use (e.g. setup.py
and README).

Added a compatibility layer so that the same API can be used in Python
2.1 and 2.2/2.3 with the major differences shuffled off into helper
modules (_compat21.py and _compat22.py).

Also bumped the package version number to 2.0.3 for some fixes to be
checked in momentarily.
2002-05-19 23:44:19 +00:00
Barry Warsaw 24fd0252c4 parseaddr(): Don't use rfc822.parseaddr() because this now implies a
double call to AddressList.getaddrlist(), and /that/ always returns an
empty list for the second and subsequent calls.

Instead, instantiate an AddressList directly, and get the parsed
addresses out of the addresslist attribute.
2002-04-15 22:00:25 +00:00
Barry Warsaw e1df15c401 AddrlistClass -> AddressList 2002-04-12 20:50:05 +00:00
Barry Warsaw 409a4c08b5 Sync'ing with standalone email package 2.0.1. This adds support for
non-us-ascii character sets in headers and bodies.  Some API changes
(with DeprecationWarnings for the old APIs).  Better RFC-compliant
implementations of base64 and quoted-printable.

Updated test cases.  Documentation updates to follow (after I finish
writing them ;).
2002-04-10 21:01:31 +00:00
Barry Warsaw c44d2c52c9 decode(), encode(): Accepting the minor optimizations from SF patch
#486375, but not the rest of it, since that changes the documented
semantics of encode().
2001-12-03 19:26:40 +00:00
Barry Warsaw e5739a69a7 formatdate(): Jason Mastaler correctly points out that divmod with a
negative modulus won't return the right values.  So always do positive
modulus on an absolute value and twiddle the sign as appropriate after
the fact.
2001-11-19 18:36:43 +00:00
Barry Warsaw cd45a36959 formatdate(): The calculation of the minutes part of the zone was
incorrect for "uneven" timezones.  This algorithm should work for even
timezones (e.g. America/New_York) and uneven timezones (e.g.
Australia/Adelaide and America/St_Johns).

Closes SF bug #483231.
2001-11-19 16:28:07 +00:00
Barry Warsaw 9aa6435398 Forgot to import time. 2001-11-09 17:45:48 +00:00
Barry Warsaw 9cff0e604a formatdate(): A better docstring. 2001-11-09 17:07:28 +00:00
Barry Warsaw aa79f4d492 formatdate(): An implementation to replace the one borrowed from
rfc822.py.  The old rfc822.formatdate() produced date strings using
obsolete syntax.  The new version produces the preferred RFC 2822
dates.

Also, an optional argument `localtime' is added, which if true,
produces a date relative to the local timezone, with daylight savings
time properly taken into account.
2001-11-09 16:59:56 +00:00
Barry Warsaw e968ead1dd Give me back my page breaks. 2001-10-04 17:05:11 +00:00
Tim Peters 527e64fd68 Whitespace normalization. 2001-10-04 05:36:56 +00:00
Barry Warsaw ba92580f01 The email package version 1.0, prototyped as mimelib
<http://sf.net/projects/mimelib>.  There /are/ API differences between
mimelib and email, but most of the implementations are shared (except
where cool Py2.2 stuff like generators are used).
2001-09-23 03:17:28 +00:00