When looking for an alias, first look for the normalized name (which
still may contain dots), then if that doesn't exist look for the name
with dots replaced by underscores. This is a little more forgiving.
Mark Hammond [Thu, 3 Oct 2002 07:24:48 +0000 (07:24 +0000)]
Trivial fix to the pep277 checkin: ensure that exceptions always have a filename attribute (previously did only when string filenames were passed, but not when unicode)
Fred Drake [Tue, 1 Oct 2002 15:30:56 +0000 (15:30 +0000)]
When the HTML output dir is specified using --dir=~/foo, the tilde
needs to be expanded by mkhowto, since the shell won't touch it except
at the start of the complete argument.
Fred Drake [Tue, 1 Oct 2002 15:20:20 +0000 (15:20 +0000)]
Change the default path to icons so that "mkhowto" does the "right thing" by
default when used for 3rd-party docs. This requires the standard Python docs
to specify a location, but they are a bit of a special case in sharing one set
of icons among several documents.
Fred Drake [Tue, 1 Oct 2002 14:17:10 +0000 (14:17 +0000)]
Split the long email package examples into separate files and use
\verbatiminput instead of the verbatim environment -- this does the "right
thing" regarding page breaks in long examples for the typeset formats, and
has nice benefits for the HTML version as well.
Strangely, two out of three patches there seem already committed; but
the essential one (get rid of the assert in object_filenames in
ccompiler.py) was not yet applied.
This makes the build procedure for Twisted work again.
This is *not* a backport candidate despite the fact that identical
code appears to exist in 2.2.2; Twisted builds fine there, so there
must have been a change elsewhere.
Barry Warsaw [Mon, 30 Sep 2002 15:51:31 +0000 (15:51 +0000)]
With help from Martin v. Loewis, clarification is added for the
semantics of header chunks using byte and Unicode strings.
Specifically,
append(): When the given string is a byte string, charset (whether
specified explicitly in the argument list or implicitly via the
constructor default) is the encoding of the byte string, and a
UnicodeError will be raised if the string cannot be decoded with that
charset. If s is a Unicode string, then charset is a hint specifying
the character set of the characters in the string. In this case, when
producing an RFC 2822 compliant header using RFC 2047 rules, the
Unicode string will be encoded using the following charsets in order:
us-ascii, the charset hint, utf-8.
__init__(): Use the global USASCII Charset instance when the charset
argument is None. Also, clarification in the docstring.
Barry Warsaw [Mon, 30 Sep 2002 15:23:17 +0000 (15:23 +0000)]
The ansi_x3.4_1968 encoding is an alias for ascii, but isn't known in
Python 2.1.3. However it's required by the email tests suite, so poke
it into the encodings aliases if it's missing. The is apparently the
approved API for doing so.
Now we can remove the hexversion shortcircuits in the test suite.
Barry Warsaw [Sat, 28 Sep 2002 21:22:52 +0000 (21:22 +0000)]
Make the tests pass under Python 2.1 but only by cheating. Python 2.1
doesn't know about the ansi-x3.4-1968 charset so skip two tests that
rely on that (msg_32.txt and msg_33.txt).
Barry Warsaw [Sat, 28 Sep 2002 17:47:56 +0000 (17:47 +0000)]
Added a feature suggested by Martin v Loewis, where a new header
encoding flag SHORTEST means to return the shortest encoding between
base64 and qp. This is used for the header_enc for utf-8. SHORTEST
isn't legal for body_enc.
Also some code cleanup:
- use True/False everywhere
- use == instead of `is' in a few places
- added _unicode() and make consistent the "is unicode" checks
- update docstrings
Fred Drake [Fri, 27 Sep 2002 15:33:11 +0000 (15:33 +0000)]
has_option(): Use the option name transform consistently.
Closes SF bug #561822.
Integrate the "code cleanup and general bug fix patch" (SF bug #545096),
contributed by Gustavo Niemeyer. This is the portion of that patch that
does not add new functionality.
Kurt B. Kaiser [Thu, 26 Sep 2002 22:13:22 +0000 (22:13 +0000)]
Fix Bug 612886 copy/paste menu items fail
(cut vs. Cut etc.)
Fix Bug 613006 Ctrl-x Unix Binding Clears Selection
(do-nothing does something :)
Leave some debugging prints behind, commented out
M EditorWindow.py
M config-keys.def
M configHandler.py
try executing 'less' in a parenthesized subshell - prevents systems like
Solaris from squawking if less isn't available. See
http://python.org/sf/612111 for details.
Barry Warsaw [Thu, 26 Sep 2002 17:21:02 +0000 (17:21 +0000)]
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.
Barry Warsaw [Thu, 26 Sep 2002 17:19:34 +0000 (17:19 +0000)]
Fixing some RFC 2231 related issues as reported in the Spambayes
project, and with assistance from Oleg Broytmann. Specifically,
get_param(), get_params(): Document that these methods may return
parameter values that are either strings, or 3-tuples in the case of
RFC 2231 encoded parameters. The application should be prepared to
deal with such return values.
get_boundary(): Be prepared to deal with RFC 2231 encoded boundary
parameters. It makes little sense to have boundaries that are
anything but ascii, so if we get back a 3-tuple from get_param() we
will decode it into ascii and let any failures percolate up.
get_content_charset(): New method which treats the charset parameter
just like the boundary parameter in get_boundary(). Note that
"get_charset()" was already taken to return the default Charset
object.
get_charsets(): Rewrite to use get_content_charset().
Barry Warsaw [Wed, 25 Sep 2002 22:07:50 +0000 (22:07 +0000)]
__version__: Bump to 2.4
Move the imports of Parser and Message inside the
message_from_string() and message_from_file() functions. This way
just "import email" won't suck in most of the submodules of the
package.
Note: this will break code that relied on "import email" giving you a
bunch of the submodules, but that was never documented and should not
have been relied on.