Commit Graph

28 Commits

Author SHA1 Message Date
Antoine Pitrou 414596ae8d Lib/email/test/data/msg_26.txt had its line endings wrong in the SVN repository.
(they were probably converted right in working copies through an SVN property)
2011-03-05 21:39:40 +01:00
Georg Brandl faa9ad2a46 Add updated .hgeol file and fix newlines in the 2.7 branch. 2011-03-05 15:06:13 +01:00
Barry Warsaw 43ad706ef4 Bug 7755: audiotest.au is arguably copyrighted material, but definitely makes
Debian unhappy.  The actual contents of the audio clip are unimportant, so
replace it with something that we know is okay.  Guido likes woodpeckers.
2010-05-05 16:15:09 +00:00
R. David Murray 4617e5085a Issue #7143: get_payload used to strip any trailing newline from a
base64 transfer-encoded payload *after* decoding it; it no longer does.
email had a special method in utils, _bdecode, specifically to do this,
so it must have served a purpose at some point, yet it is clearly wrong
per RFC.  Fixed with Barry's approval, but no backport.  Email package
minor version number is bumped, now version 4.0.1.

Patch by Joaquin Cuenca Abela.
2010-03-08 02:04:06 +00:00
R. David Murray 51f1204590 Issue 7970: When email.Parser.Parser parses a MIME message of type
message/rfc822 it turns it into an object whose body consists of
a list containing a single Message object.  HeaderParser, on the
other hand, just copies the body as a string.  Generator.flatten
has a special handler for the message mime type that expected the
body to be the one item list.  This fails if the message was parsed
by HeaderParser.  So we now check to see if the body is a string
first, and if so just we just emit it.
2010-02-21 04:23:00 +00:00
R. David Murray ed44dfa4c7 Issue #1670765: Prevent email.generator.Generator from re-wrapping
headers in multipart/signed MIME parts, which fixes one of the sources of
invalid modifications to such parts by Generator.  Patch and tests by
Martin von Gagern.
2010-01-16 05:15:17 +00:00
R. David Murray 0c8bee6393 Issue #7082: When falling back to the MIME 'name' parameter, the
correct place to look for it is the Content-Type header.

Patch by Darren Worrall.
2009-10-09 21:50:54 +00:00
Martin v. Löwis 3a4414855c Revert eol-style to CRLF. 2008-06-14 00:41:41 +00:00
Martin v. Löwis 06510b2213 Run svneol.py on all sources. 2008-06-13 22:38:33 +00:00
Barry Warsaw ad9afcf213 Actually this file should have svn:eol-style CRLF since it's specifically
testing line ending compatibility.
2006-03-04 04:55:02 +00:00
Tim Peters c32886dad8 Set eol-style to native -- doesn't appear to be any reason
for it to claim it has mime-type application/octet-stream.
2006-03-04 02:57:23 +00:00
Barry Warsaw a0f28efcd1 Ported 42075 from release23-maint branch.
SF bug #1403349 solution for email 3.0; some MUAs use the 'file' parameter
name in the Content-Distribution header, so Message.get_filename() should fall
back to using that.  Will port to the Python 2.5 trunk.

Also, bump the email package version to 3.0.1 for eventual release.  Of
course, add a test case too.

XXX Need to update the documentation.
2006-01-17 04:49:07 +00:00
Barry Warsaw 7cf9ce2440 Fixes for SF #1076485, which I'll apply to the CVS head too. The problem was
caused by a self._input.readline() call that wasn't checking for the
NeedsMoreData marker.

msg_43.txt contains a message that illustrates the problem, when
email.message_from_*() is called.  That interface uses the Parser API, which
splits reads into 8192 byte chunks.  It so happens that for the test message,
the 8192 chunk falls inside a message/delivery-status, which is where in the
FeedParser the readline() call was that didn't check for NeedsMoreData.

I also added an assert to unreadline() so it'll be more evident if an attempt
to push back NeedsMoreData ever happens again.

Bump the email package version number.
2004-12-05 03:45:42 +00:00
Barry Warsaw 6bd55ee1ef An example message for SF bug # 1030941. 2004-10-09 22:57:57 +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 ac606ccb79 forward porting from release23-maint 2004-05-13 23:18:54 +00:00
Barry Warsaw d0c12af7ef Another evil test from Anthony's suite. This one has an inner part with the
same boundary as the outer part.
2004-05-13 20:13:48 +00:00
Barry Warsaw dce231fb14 A boiled down example from Anthony's MIME torture tests. This one has a
separating boundary for an outer part inside an inner part.
2004-05-13 20:12:32 +00:00
Barry Warsaw 769f14a7c9 A boiled down message/external-body example from Anthony's torture test. 2004-05-11 22:20:59 +00:00
Barry Warsaw bce827bf12 An example with multiple boundary lines. 2004-05-11 22:20:05 +00:00
Barry Warsaw 09356d419c Like msg_12.txt but with some extra vertical whitespace around the inner
message's end boundary.
2004-05-09 03:17:29 +00:00
Barry Warsaw f9e0bd8df8 Adjust tests for no newline appending to MIMEText.__init__()'s _text
argument.
2003-03-11 05:10:46 +00:00
Barry Warsaw c99c08c764 A copy of the audio test file from Lib/test, 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.
2002-12-30 17:44:27 +00:00
Barry Warsaw 847fdbbe71 A message with no separating blank line between the headers and the
body.  A test message for SF bug #633527.
2002-11-05 21:29:47 +00:00
Barry Warsaw 00e6a02ef8 Test case, distilled from SF bug #631350, where a subobject in a
multipart/digest isn't a message/rfc822.  This is legal, but counter
to recommended practice in RFC 2046, $5.1.5.
2002-11-05 20:53:18 +00:00
Barry Warsaw 9c74569ec9 Fixing some RFC 2231 related issues as reported in the Spambayes
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.
2002-09-26 17:21:02 +00:00
Barry Warsaw dad90c202a A sample message with broken MIME boundaries. 2002-09-10 15:43:30 +00:00
Barry Warsaw 629038093c The email package's tests live much better in a subpackage
(i.e. email.test), so move the guts of them here from Lib/test.  The
latter directory will retain stubs to run the email.test tests using
Python's standard regression test.

test_email_torture.py is a torture tester which will not run under
Python's test suite because I don't want to commit megs of data to
that project (it will fail cleanly there).  When run under the mimelib
project it'll stress test the package with megs of message samples
collected from various locations in the wild.

email/test/data is a copy of Lib/test/data.  The fate of the latter is
still undecided.
2002-07-19 22:29:49 +00:00