Barry Warsaw [Wed, 10 Apr 2002 21:01:31 +0000 (21:01 +0000)]
Sync'ing with standalone email package 2.0.1. This adds support for
non-us-ascii character sets in headers and bodies. Some API changes
(with DeprecationWarnings for the old APIs). Better RFC-compliant
implementations of base64 and quoted-printable.
Updated test cases. Documentation updates to follow (after I finish
writing them ;).
Fred Drake [Wed, 10 Apr 2002 04:20:33 +0000 (04:20 +0000)]
When adding a name to the table of macros and environments, make sure it
is not already present. If it is, raise an exception, since that should not
happen in a well-defined conversion.
Thomas Heller [Tue, 9 Apr 2002 14:14:38 +0000 (14:14 +0000)]
Set the warn_dir option to 0 before running the install command.
This suppresses bogus warnings about modules installed into a directory
not in sys.path.
Tim Peters [Mon, 8 Apr 2002 04:13:12 +0000 (04:13 +0000)]
SF bug 538827: Python open w/ MSVC6: bad error msgs.
open_the_file: Some (not all) flavors of Windows set errno to EINVAL
when passed a syntactically invalid filename. Python turned that into an
incomprehensible complaint about the mode string. Fixed by special-casing
MSVC.
- A type can now inherit its metatype from its base type. Previously,
when PyType_Ready() was called, if ob_type was found to be NULL, it
was always set to &PyType_Type; now it is set to base->ob_type,
where base is tp_base, defaulting to &PyObject_Type.
- PyType_Ready() accidentally did not inherit tp_is_gc; now it does.
- Changed new-style class instantiation so that when C's __new__
method returns something that's not a C instance, its __init__ is
not called. [SF bug #537450]
Fred Drake [Fri, 5 Apr 2002 23:01:14 +0000 (23:01 +0000)]
Move reference material on PyArg_Parse*() out of the Extending & Embedding
document to the C API reference. Move some instructional text from the API
reference to the Extending & Embedding manual.
Fix the descriptions of the es and es# formats for PyArg_Parse*().
This closes SF bug #536516.
Change pickling format for bools to use a backwards compatible
encoding. This means you can pickle True or False on Python 2.3
and Python 2.2 or before will read it back as 1 or 0. The code
used for pickling bools before would create pickles that could
not be read in previous Python versions.
Tim Peters [Fri, 5 Apr 2002 04:32:29 +0000 (04:32 +0000)]
Widespread, but mostly in _PyMalloc_Malloc: optimize away all expensive
runtime multiplications and divisions, via the scheme developed with
Vladimir Marangozov on Python-Dev. The pool_header struct loses its
capacity member, but gains nextoffset and maxnextoffset members; this
still leaves it at 32 bytes on a 32-bit box (it has to be padded to a
multiple of 8 bytes).
A much revised version of SF patch 514662, by Naofumi Honda. This
speeds up __getitem__ and __setitem__ in subclasses of built-in
sequences.
It's much revised because I took the opportunity to refactor the code
somewhat (moving a large section of duplicated code to a helper
function) and added comments to a series of functions.
Fred Drake [Thu, 4 Apr 2002 20:41:34 +0000 (20:41 +0000)]
Support manual proxy configuration for simple urlopen() operations.
This change is similar to the supplied patch, but does not save the opener
when a proxy configuration is specified.
This closes SF patch #523415.
Tim Peters [Thu, 4 Apr 2002 20:02:04 +0000 (20:02 +0000)]
SF bug 497854: Short-cuts missing for All Users
Fix Windows-specific install glitch. Tested on Win2K, but I can't test
on XP.
Already checked in to the release22-maint branch.
Fred Drake [Thu, 4 Apr 2002 17:57:08 +0000 (17:57 +0000)]
Avoid creating circular references between the ExpatParser and the
ContentHandler. While GC will eventually clean up, it can take longer than
normal for applications that create a lot of strings (or other immutables)
rather without creating many containers.
This closes SF bug #535474.
Removed old Digital Creations copyright/license notices (with
permission from Paul Everitt). Also removed a few other references to
Digital Creations and changed the remaining ones to Zope Corporation.
Clarifying code rearrangement and comments by David Abrahams. I've
got to admit that I haven't reviewed this carefully, but it looks okay
from 30,000 views, and doesn't break anything. (SF patch 536407.)
Tim Peters [Thu, 4 Apr 2002 04:44:32 +0000 (04:44 +0000)]
_PyMalloc_{Malloc, Realloc}: Strive to meet the doc's promises about
what these do given a 0 size argument. This is so that when pymalloc
is enabled, we don't need to wrap pymalloc calls in goofy little
routines special-casing 0. Note that it's virtually impossible to meet
the doc's promise that malloc(0) will never return NULL; this makes a
best effort, but not an insane effort. The code does promise that
realloc(not-NULL, 0) will never return NULL (malloc(0) is much harder).
_PyMalloc_Realloc: Changed to take over all requests for 0 bytes, and
rearranged to be a little quicker in expected cases.
All over the place: when resorting to the platform allocator, call
free/malloc/realloc directly, without indirecting thru macros. This
should avoid needing a nightmarish pile of #ifdef-ery if PYMALLOC_DEBUG
is changed so that pymalloc takes over all Py(Mem, Object} memory
operations (which would add useful debugging info to PyMem_xyz
allocations too).
Add the 'bool' type and its values 'False' and 'True', as described in
PEP 285. Everything described in the PEP is here, and there is even
some documentation. I had to fix 12 unit tests; all but one of these
were printing Boolean outcomes that changed from 0/1 to False/True.
(The exception is test_unicode.py, which did a type(x) == type(y)
style comparison. I could've fixed that with a single line using
issubtype(x, type(y)), but instead chose to be explicit about those
places where a bool is expected.
Still to do: perhaps more documentation; change standard library
modules to return False/True from predicates.
Jack Jansen [Wed, 3 Apr 2002 21:52:10 +0000 (21:52 +0000)]
e macresource.need() to open the W resource file in the application init
code (if it isn't open already).
PythonIDE still opens the resource file "manually" because it also uses
presence of the CURS resource to determine whether it needs to adjust
sys.path.