Commit Graph

492 Commits

Author SHA1 Message Date
Andrew Svetlov 737fb89dd1 Issue #16714: use 'raise' exceptions, don't 'throw'.
Patch by Serhiy Storchaka.
2012-12-18 21:14:22 +02:00
R David Murray 638d40b433 #15249: Mangle From lines correctly when body contains invalid bytes.
Fix by Colin Su.  Test by me, based on a test written by Petri Lehtinen.
2012-08-24 11:14:13 -04:00
R David Murray 6a31bc6d81 #15232: correctly mangle From lines in MIME preamble and epilogue 2012-07-22 21:47:53 -04:00
Alexander Belopolsky a07548e97b Issue #14653: email.utils.mktime_tz() no longer relies on system
mktime() when timezone offest is supplied.
2012-06-21 20:34:09 -04:00
R David Murray 3ac8c780f4 Update out of date docstring. 2012-06-17 15:26:35 -04:00
R David Murray 1b6c724df0 #11686: add missing entries to email __all__ lists.
Original patch by Steffen Daode Nurpmeso
2012-03-16 22:43:05 -04:00
R David Murray 9fd170e2d0 #14062: fix BytesParser handling of linesep for Header objects
This also affected smtplib.SMTP.send_message, which calls BytesParser.
2012-03-14 14:05:03 -04:00
R David Murray 7441a7aedd #14291: if a header has non-ascii unicode, default to CTE using utf-8
In Python2, if a unicode string was assigned as the value of a header,
email would automatically CTE encode it using the UTF8 charset.
This capability was lost in the Python3 translation, and this patch
restores it.

Patch by Ali Ikinci, assisted by R. David Murray.

I also added a fix for the mailbox test that was depending (with a comment
that it was a bad idea to so depend) on non-ASCII causing message_from_string
to raise an error.  It now uses support.patch to induce an error during
message serialization.
2012-03-14 02:59:51 -04:00
Florent Xicluna 992d9e081f Fix few typos. 2011-11-11 19:35:42 +01:00
R David Murray e5e366c856 #11584: make Header and make_header handle binary unknown-8bit input
Analogous to the decode_header fix, this fix makes Header.append and
make_header correctly handle the unknown-8bit charset introduced by email5.1,
when the input to them is binary strings.  Previous to this fix the
make_header(decode_header(x)) == x invariant was broken in the face of the
unknown-8bit charset.
2011-06-18 12:57:28 -04:00
R David Murray 6bdb1769dc #11584: make decode_header handle Header objects correctly
This updates b21fdfa0019c, which fixed this bug incorrectly.
2011-06-18 12:30:55 -04:00
R David Murray 01581ee0b7 #11492: rewrite header folding algorithm. Less code, more passing tests. 2011-04-18 10:04:34 -04:00
R David Murray a2860e8b51 Improve message.py test coverage to 100%.
coverage.py reports 99% on branch coverage, but that appears to be
a bug or limitation in coverage.py.
2011-04-16 09:20:30 -04:00
Ezio Melotti a3d0be456c Merge with 3.1. 2011-04-13 16:44:18 +03:00
Ezio Melotti ce073cdac7 Fix typo in docstring. 2011-04-13 16:43:21 +03:00
R David Murray 94f90dd4a1 Merge: Add maxlinelen to docstring, delete obsolete wording 2011-04-12 15:01:28 -04:00
R David Murray 308f14aeae Add maxlinelen to docstring, delete obsolete wording 2011-04-12 15:00:44 -04:00
R David Murray 80221ed0c0 Merge #11492: fix header truncation on folding when there are runs of split chars.
Not a complete fix for this issue.
2011-04-07 20:56:31 -04:00
R David Murray e1292a25d8 #11492: fix header truncation on folding when there are runs of split chars.
Not a complete fix for this issue.
2011-04-07 20:54:03 -04:00
R David Murray b65df26830 Merge: Improve test coverage of _split_ascii method. 2011-04-07 20:40:01 -04:00
R David Murray 7da4db118e Improve test coverage of _split_ascii method. 2011-04-07 20:37:17 -04:00
R David Murray c5c1472895 #11605: don't use set/get_payload in feedparser; they do conversions.
Really the whole API needs to be gone over to restore the
separation of concerns; but that's what email6 is about.
2011-04-06 08:13:02 -04:00
R David Murray 041015cc70 #11584: Since __getitem__ returns headers, make decode_header handle them.
Why I consider this a bug rather than an API change: the API change was
to Message, which didn't used to return Headers unless you added them
yourself.  Now it does (for 8bit binary header input), so decode_header
needs to be able to handle them.
2011-03-25 15:10:55 -04:00
R David Murray c7d28be62f Merge #11606: improved body_encode algorithm, no longer produces overlong lines 2011-03-24 12:27:23 -04:00
R David Murray b938c8c253 #11606: improved body_encode algorithm, no longer produces overlong lines
Algorithm and initial patch by Michael Henry.
2011-03-24 12:19:26 -04:00
R David Murray 523b41c4b3 Merge #11590: fix quoprimime decode handling of empty strings and line endings. 2011-03-23 15:27:04 -04:00
R David Murray cafd79d904 #11590: fix quoprimime decode handling of empty strings and line endings. 2011-03-23 15:25:55 -04:00
R David Murray 3d9e973abd Merge #11589: add additional tests for the email quoprimime module. 2011-03-23 14:27:18 -04:00
R David Murray ec1b5b88ee #11589: add additional tests for the email quoprimime module.
Patch by Michael Henry.
2011-03-23 14:19:05 -04:00
R David Murray a215023b78 #11243: tests and fixes for handling of 'dirty data' in additional methods 2011-03-16 21:11:23 -04:00
R David Murray 4e4326829f Merge #11401 fix from 3.1. 2011-03-16 18:27:34 -04:00
R David Murray de91276a5c #11401: handle headers with no value. 2011-03-16 18:26:23 -04:00
R David Murray 78099bb153 Merge #9298 fix. 2011-03-16 16:13:07 -04:00
R David Murray 6d94bd470e #9298: restore proper folding of base64 encoded bodies.
Patch by Yves Dorfsman.
2011-03-16 15:52:22 -04:00
Ezio Melotti 3b3499ba69 #11565: Merge with 3.1. 2011-03-16 11:35:38 +02:00
Ezio Melotti 13925008dc #11565: Fix several typos. Patch by Piotr Kasprzyk. 2011-03-16 11:05:33 +02:00
R David Murray 4a0b60c527 Merge #11555 as_string doc fix from 3.1. 2011-03-15 14:02:53 -04:00
R David Murray 7dedcb4644 #11555: update doc for 3.x change to as_string mangle_from default. 2011-03-15 14:01:18 -04:00
R David Murray 106f8e3ea4 Remove obsolete comment. 2011-03-15 12:48:41 -04:00
R David Murray 56a9d7e3da #11554: reactivate test_email_codecs, and make it pass.
The fix is to charset.py, which was not doing the encoding to the
correct output character set when doing a body_encode for either
the shift-jis or euc-jp charsets.  There's also a fix for handling
a bytes input in encoders.py.

Patch by Michael Henry, comment changes by me.
2011-03-15 12:20:02 -04:00
Ezio Melotti 4969f709cc #11515: Merge with 3.1. 2011-03-15 05:59:46 +02:00
Ezio Melotti 42da663e6f #11515: fix several typos. Patch by Piotr Kasprzyk. 2011-03-15 05:18:48 +02:00
R David Murray 3a6152f3b3 Fix header encoding of long headers when using euc-jp and shift_jis.
When a header was long enough to need to be split across lines, the
input charset name was used instead of the output charset name in
the encoded words.  This make a difference only for the two charsets
above.
2011-03-14 21:13:03 -04:00
R David Murray cd37dfcfac Harmonize linesep docstrings, and fix the quoting of \r\n 2011-03-14 18:35:56 -04:00
Antoine Pitrou d1b1991fd4 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:49:50 +01:00
Georg Brandl 49857f8a93 Add updated .hgeol file and fix newlines in the 3.2 branch. 2011-03-05 15:11:35 +01:00
Georg Brandl 2774310c27 Merged revisions 87627,87638,87739,87760,87771,87787,87984,87986,88108,88115,88144,88165,88329,88364-88365,88369-88370,88423-88424 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k

........
  r87627 | georg.brandl | 2011-01-02 15:23:43 +0100 (So, 02 Jan 2011) | 1 line

  #1665333: add more docs for optparse.OptionGroup.
........
  r87638 | georg.brandl | 2011-01-02 20:07:51 +0100 (So, 02 Jan 2011) | 1 line

  Fix code indentation.
........
  r87739 | georg.brandl | 2011-01-04 18:27:13 +0100 (Di, 04 Jan 2011) | 1 line

  Fix exception catching.
........
  r87760 | georg.brandl | 2011-01-05 11:59:48 +0100 (Mi, 05 Jan 2011) | 1 line

  Fix duplicate end tag.
........
  r87771 | georg.brandl | 2011-01-05 22:47:47 +0100 (Mi, 05 Jan 2011) | 1 line

  On Py3k, -tt and -3 are no-op and unsupported respectively.
........
  r87787 | georg.brandl | 2011-01-06 10:15:45 +0100 (Do, 06 Jan 2011) | 1 line

  Remove doc for nonexisting parameter.
........
  r87984 | georg.brandl | 2011-01-13 08:24:40 +0100 (Do, 13 Jan 2011) | 1 line

  Add semicolon for consistency.
........
  r87986 | georg.brandl | 2011-01-13 08:31:18 +0100 (Do, 13 Jan 2011) | 1 line

  Fix the example output of count().
........
  r88108 | georg.brandl | 2011-01-19 09:42:03 +0100 (Mi, 19 Jan 2011) | 1 line

  Suppress trailing spaces in table paragraphs.
........
  r88115 | georg.brandl | 2011-01-19 21:05:49 +0100 (Mi, 19 Jan 2011) | 1 line

  #10944: add c_bool to types table.
........
  r88144 | georg.brandl | 2011-01-22 23:06:24 +0100 (Sa, 22 Jan 2011) | 1 line

  #10983: fix several bugs in the _tunnel implementation that seem to have missed while porting between branches.  A unittest is needed!
........
  r88165 | georg.brandl | 2011-01-24 20:53:18 +0100 (Mo, 24 Jan 2011) | 1 line

  Typo fix.
........
  r88329 | georg.brandl | 2011-02-03 08:08:25 +0100 (Do, 03 Feb 2011) | 1 line

  Punctuation typos.
........
  r88364 | georg.brandl | 2011-02-07 13:10:46 +0100 (Mo, 07 Feb 2011) | 1 line

  #11138: fix order of fill and align specifiers.
........
  r88365 | georg.brandl | 2011-02-07 13:13:58 +0100 (Mo, 07 Feb 2011) | 1 line

  #8691: document that right alignment is default for numbers.
........
  r88369 | georg.brandl | 2011-02-07 16:30:45 +0100 (Mo, 07 Feb 2011) | 1 line

  Consistent heading spacing, and fix two typos.
........
  r88370 | georg.brandl | 2011-02-07 16:44:27 +0100 (Mo, 07 Feb 2011) | 1 line

  Spelling fixes.
........
  r88423 | georg.brandl | 2011-02-15 13:41:17 +0100 (Di, 15 Feb 2011) | 1 line

  Apply logging SocketHandler doc update by Vinay.
........
  r88424 | georg.brandl | 2011-02-15 13:44:43 +0100 (Di, 15 Feb 2011) | 1 line

  Remove editing slip.
........
2011-02-25 10:18:11 +00:00
R. David Murray 43b2f457a0 Merged revisions 87136,87221,87256,87337-87338,87571,87839,88164 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k


........
  r87136 | r.david.murray | 2010-12-08 17:53:00 -0500 (Wed, 08 Dec 2010) | 6 lines

  Have script_helper._assert_python strip refcount strings from stderr.

  This makes the output of the function and those that depend on it
  independent of whether or not they are being run under a debug
  build.
........
  r87221 | r.david.murray | 2010-12-13 19:55:46 -0500 (Mon, 13 Dec 2010) | 4 lines

  #10699: fix docstring for tzset: it does not take a parameter

  Thanks to Garrett Cooper for the fix.
........
  r87256 | r.david.murray | 2010-12-14 21:19:14 -0500 (Tue, 14 Dec 2010) | 2 lines

  #10705: document what the values of debuglevel are and mean.
........
  r87337 | r.david.murray | 2010-12-17 11:11:40 -0500 (Fri, 17 Dec 2010) | 2 lines

  #10559: provide instructions for accessing sys.argv when first mentioned.
........
  r87338 | r.david.murray | 2010-12-17 11:29:07 -0500 (Fri, 17 Dec 2010) | 2 lines

  #10454: clarify the compileall docs and help messages.
    [compileall.py changes not backported.]
........
  r87571 | r.david.murray | 2010-12-29 14:06:48 -0500 (Wed, 29 Dec 2010) | 2 lines

  Fix same typo in docs.
........
  r87839 | r.david.murray | 2011-01-07 16:57:25 -0500 (Fri, 07 Jan 2011) | 9 lines

  Fix formatting of values with embedded newlines when rfc2047 encoding

  Before this patch if a value being encoded had an embedded newline,
  the line following the newline would have no leading whitespace,
  and the whitespace it did have was encoded into the word.  Now
  the existing whitespace gets turned into a blank, the way it does
  in other header reformatting, and the _continuation_ws gets added
  at the beginning of the encoded line.
........
  r88164 | r.david.murray | 2011-01-24 14:34:58 -0500 (Mon, 24 Jan 2011) | 12 lines

  #10960: fix 'stat' links, link to lstat from stat, general tidy of stat doc.

  Original patch by Michal Nowikowski, with some additions and wording
  fixes by me.

  I changed the wording from 'Performs a stat system call' to 'Performs
  the equivalent of a stat system call', since on Windows there are no
  stat/lstat system calls involved.  I also extended Michal's breakout
  of the attributes into a list to the other paragraphs, and rearranged
  the order of the paragraphs in the 'stat' docs to make it flow
  better and put it in what I think is a more logical/useful order.
........
2011-02-11 03:13:19 +00:00
R. David Murray 7372a07fd0 #11019: Make BytesGenerator handle Message with None body.
Bug discovery and initial patch by Victor Stinner.
2011-01-26 21:21:32 +00:00
R. David Murray bdd2d93bfe Revert r88197. I'll refix correctly once there is a test. 2011-01-26 02:31:37 +00:00