disabled
  +   lm_JJh Ȯ41h._I| 	H    :mod:`email.encoders`: Encoders
-------------------------------

.. module:: email.encoders
   :synopsis: Encoders for email message payloads.


When creating :class:`~email.message.Message` objects from scratch, you often
need to encode the payloads for transport through compliant mail servers. This
is especially true for :mimetype:`image/\*` and :mimetype:`text/\*` type messages
containing binary data.

The :mod:`email` package provides some convenient encodings in its
:mod:`encoders` module.  These encoders are actually used by the
:class:`~email.mime.audio.MIMEAudio` and :class:`~email.mime.image.MIMEImage`
class constructors to provide default encodings.  All encoder functions take
exactly one argument, the message object to encode.  They usually extract the
payload, encode it, and reset the payload to this newly encoded value.  They
should also set the :mailheader:`Content-Transfer-Encoding` header as appropriate.

Note that these functions are not meaningful for a multipart message.  They
must be applied to individual subparts instead, and will raise a
:exc:`TypeError` if passed a message whose type is multipart.

Here are the encoding functions provided:


.. function:: encode_quopri(msg)

   Encodes the payload into quoted-printable form and sets the
   :mailheader:`Content-Transfer-Encoding` header to ``quoted-printable`` [#]_.
   This is a good encoding to use when most of your payload is normal printable
   data, but contains a few unprintable characters.


.. function:: encode_base64(msg)

   Encodes the payload into base64 form and sets the
   :mailheader:`Content-Transfer-Encoding` header to ``base64``.  This is a good
   encoding to use when most of your payload is unprintable data since it is a more
   compact form than quoted-printable.  The drawback of base64 encoding is that it
   renders the text non-human readable.


.. function:: encode_7or8bit(msg)

   This doesn't actually modify the message's payload, but it does set the
   :mailheader:`Content-Transfer-Encoding` header to either ``7bit`` or ``8bit`` as
   appropriate, based on the payload data.


.. function:: encode_noop(msg)

   This does nothing; it doesn't even set the
   :mailheader:`Content-Transfer-Encoding` header.

.. rubric:: Footnotes

.. [#] Note that encoding with :meth:`encode_quopri` also encodes all tabs and space
   characters in the data.

     h      disabled
      	355_I|Mjq؂ <o c    	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>
  "   lY>e8n4oh      disabled
  
   355 c    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>
  9   lY>e8\l*bѿhaY>e8Aq.2ʘo      13:66
      lY>e8Aq.2ʘo0  	   0  $   lm_JJh Ȯ41heo ?     ****************************
  What's New in Python 2.1
****************************

:Author: A.M. Kuchling

.. |release| replace:: 1.01

.. $Id: whatsnew21.tex 50964 2006-07-30 03:03:43Z fred.drake $


Introduction
============

This article explains the new features in Python 2.1.  While there aren't as
many changes in 2.1 as there were in Python 2.0, there are still some pleasant
surprises in store.  2.1 is the first release to be steered through the use of
Python Enhancement Proposals, or PEPs, so most of the sizable changes have
accompanying PEPs that provi