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.
Tim Peters [Wed, 25 Sep 2002 20:32:28 +0000 (20:32 +0000)]
SF bug 613233: test_threadedtempfile hangs
A possibility to deadlock (on the hidden import lock) was created here
in 2.3, seemingly when tempfile.py started to call functions in
random.py. The cure is "the usual": don't spawn threads as a side
effect of importing, when the spawned threads themselves do imports
(directly or indirectly), and the code that spawned the threads is
waiting for the threads to finish (they can't finish, because they're
waiting for the import lock the spawner still holds). Worming around
this is why the "test_main" mechanism was introduced in regrest, so
it's a straightforward fix.
NOT a bugfix candidate; the problem was introduced in 2.3.
Fred Drake [Wed, 25 Sep 2002 16:29:17 +0000 (16:29 +0000)]
Add regression test for a bug found in the version of the markupbase
module used in the Zope TAL implementation. The bug was already fixed
in the Python standard library, but the regression test would be good
to keep around.
Fred Drake [Tue, 24 Sep 2002 16:24:54 +0000 (16:24 +0000)]
Be more careful with the type of the xmlhandlersetter; it takes an
XML_Parser, which happens to be a pointer type, not an XML_Parser*.
This generated warnings when compiled with Expat 1.95.5, which no
longer defines XML_Parser to be void*.
Barry Warsaw [Mon, 23 Sep 2002 22:46:49 +0000 (22:46 +0000)]
Brett's fixes for various bugs and coding issues. Closes SF patch #
593560, with some minor cleanups, line folding and whitespace
normalization by Barry.
Tweak description of PortableUnixMailbox: "From " lines are actually
quoted (or mangled) *at* delivery-time, not "well before" it. (At least
that's how Exim and qmail work.)
This adds new methods heading(), setheading(), position(),
window_width(), window_height(), setx(), and sety(), to make this more
functionality-compatible with Logo turtle graphics (Attila's last
words, not mine :-). I had to fix the sety() code which was broken in
Attila's patch.
I'm not adopting the functionality change that Attila claimed was a
bugfix (no output without tracing), because I disagree that it's a
bug.
ReST-ification of the NEWS file. While the total number of changes are
fairly large, most are caused by reformatting section and subsection
headings. The changes fall into the following categories:
* reformatted section and subsection headers.
* escaped isolated asterisks which would be interpreted as starting bold
or italic text (e.g. "void (*)(PyObject \*)").
* quoted stuff that looks like internal references but isn't
(e.g. ``PyCmp_``).
* changed visually balanced quotes to just use apostrophes
(e.g. "'string'" instead of "`string'").
* introduced and indenting multiline chunks of code.
Jeremy Hylton [Thu, 19 Sep 2002 22:57:26 +0000 (22:57 +0000)]
whichmodule() should skip dummy package entries in sys.modules.
This fixes the charming, but unhelpful error message for
>>> pickle.dumps(type.__new__)
Can't pickle <built-in method __new__ of type object at 0x812a440>: it's not the same object as datetime.math.__new__
Two more cases of switch(PySequence_Size()) without checking for case -1.
(Same problem as last checkin for SF bug 610610)
Need to clear the error and proceed.
Fix SF bug 610610 (reported by Martijn Pieters, diagnosed by Neal Norwitz).
The switch in Exception__str__ didn't clear the error if
PySequence_Size() raised an exception. Added a case -1 which clears
the error and falls through to the default case.
Definite backport candidate (this dates all the way to Python 2.0).
Kurt B. Kaiser [Wed, 18 Sep 2002 03:26:47 +0000 (03:26 +0000)]
Merge Py Idle changes:
Rev 1.6 GvR
Finally fix SF bug #441172, using a variant of patch ##443626:
canceling an edit operation would not revert the value of the field.
The fix takes care to destroy the Entry object, as suggested in the
patch.
Kurt B. Kaiser [Wed, 18 Sep 2002 02:29:59 +0000 (02:29 +0000)]
Merge Py Idle changes:
Rev 1.35 fdrake
Use string.ascii_letters instead of string.letters (SF bug #226706).
Move computation of sets of characters out of the body of the function
that uses them.
Rev 1.36 tim_one
Convert a pile of obvious "yes/no" functions to return bool
Rev 1.37
(skip, done differently in Idlefork)
Rev 1.38 loewis
Patch #590913: PEP 263 support.
Rev 1.39 loewis
Convert characters from the locale's encoding on output.
Reject characters outside the locale's encoding on input.
migrate news about 2.1 and earlier releases from NEWS to HISTORY in
preparation for ReST-ification of NEWS. (Also tests checkin ability
from my new Powerbook. woohoo!)