+Almost everything in this release is a pure bugfix and is backported
+from a corresponding bugfix alrady applied to Python 2.3. While at
+the time of writing, Python 2.3 is still in pre-alpha form, only
+accessible via CVS, it receives continuous and extensive testing by
+its developers. The list below is not a complete list of fixed bugs;
+it only lists fixed bugs that someone might be interested in hearing
+about. Documentation fixes are not listed.
+Tip: to quickly find SourceForge bug or patch NNNNNN, use an URL of
+the form www.python.org/sf/NNNNNN.
- Changed new-style class instantiation so that when C's __new__
behavior. If problems with this are reported within a week of the
release of 2.2.2 beta 1, we may revert this change.)
+- Fix a core dump in type_new() when looking for the tp_init() slot.
+ This could call a garbage pointer when e.g. an ExtensionClass was
+- A variety of very obscure end-case bugs in new-style classes were
+ fixed, some of which could be made to trigger core dumps with absurd
- u'%c' will now raise a ValueError in case the argument is an
integer outside the valid range of Unicode code point ordinals.
+- Several small patches were applied that aren't bugfixes (and aren't
+ even backported from 2.3!) but make life easier for tools like Armin
+ Rigo's Psyco. [SF patches 617309, 617311, 617312]
+- Made conversion failure error message consistent between types.
+- The complex() built-in now finds __complex__() in new-style
+ classes. [SF bug 563740]
+- Fixed a problem in the UTF-8 decoder where a Unicode literal
+ containing a "lone surrogate" would cause a .pyc file to be written
+ that could not be read. [SF bug 610783]
+- Fixed a problem with code objects whose stacksize is >= 2**15.
+ These cannot be marshalled correctly. As a work-around, don't write
+ a .pyc file in this case. [SF bug 561858]
+- Fixed several bugs that could cause issubclass() and isinstance() to
+ leave an exception lingering behind while returning a non-error
+- The Unicode replace() method would do the wrong thing for a unicode
+ subclass when there were zero string replacements. [SF bug 599128]
+- Fixed some endcase bugs in Unicode rfind()/rindex() and endswith().
- When x is an object whose class implements __mul__ and __rmul__,
1.0*x would correctly invoke __rmul__, but 1*x would erroneously
invoke __mul__. This was due to the sequence-repeat code in the int
type. This has been fixed now.
-- If a dying instance of a new-style class got resurrected by its class's
- __del__ method, Python aborted with a fatal error.
+- The __delete__ method wrapper wasn't supported. [SF patch 588728]
+- If a dying instance of a new-style class got resurrected by its
+ class's __del__ method, Python aborted with a fatal error.
- Source that creates parse nodes with an extremely large number of
children (e.g., test_longexp.py) triggers problems with the
- Classes using __slots__ are now properly garbage collected.
+- Fixed an inefficiency in clearing the stack frame of new frame
- Repaired a slow memory leak possible only in programs creating a
- great many cyclic structures involving frames. Reported on
- SourceForge as bug 543148.
+ great many cyclic structures involving frames [SF bug 543148].
+- Fixed an esoteric performance glitch in GC. [SF bug 574132]
- A method zfill() was added to str and unicode, that fills a numeric
string to the left with zeros. For example,
these make no sense. Since this was documented, they're being
-- String methods lstrip(), rstrip() and strip() now take an optional
- argument that specifies the characters to strip. For example,
- "Foo!!!?!?!?".rstrip("?!") -> "Foo". In addition, "200L".strip("L")
- will return "200". This is useful for replacing code that assumed
- longs will always be printed with a trailing "L".
+- String and Unicode methods lstrip(), rstrip() and strip() now take
+ an optional argument that specifies the characters to strip. For
+ example, "Foo!!!?!?!?".rstrip("?!") -> "Foo". In addition,
+ "200L".strip("L") will return "200". This is useful for replacing
+ code that assumed longs will always be printed with a trailing "L".
+- A change to how new-style classes deal with __doc__: you can now
+ supply a __doc__ descriptor that returns something different for a
+ class than for instances of that class.
-- If the size passed to mmap.mmap() is larger than the length of the
- file on non-Windows platforms, a ValueError is raised. [SF bug 585792]
+- In readline.c: change completion to avoid appending a space
+ character; this is usually more useful when editing Python code.
+- Fixed a crash in debug builds for marshal.dumps( * 1000). [SF
+- In cPickle.c: more robust test of whether global objects are
+ accessible. Added recursion limit to pickling [SF bug 576084]. Try
+ the persistent id code *before* calling save_global().
+- In mmapmpdule.c: if the size passed to mmap() is larger than the
+ length of the file on non-Windows platforms, a ValueError is
+ raised. [SF bug 585792]
+- In socketmodule.c: improve robustness of IPv6 code.
+- In _hotshot.c: fix broken logic in the logreader object.
+- In zlibmodule.c: fix for crash on second flush() call. [SF bug
API, so you should read the section in the library manual about the
-- random.gauss() uses a piece of hidden state used by nothing else,
- and the .seed() and .whseed() methods failed to reset it. In other
- words, setting the seed didn't completely determine the sequence of
- results produced by random.gauss(). It does now. Programs repeatedly
- mixing calls to a seed method with calls to gauss() may see different
-- Some fixes in the copy module: when an object is copied through its
- __reduce__ method, there was no check for a __setstate__ method on
- the result [SF patch 565085]; deepcopy should treat instances of
- custom metaclasses the same way it treats instances of type 'type'
+- In pydoc.py: Extend stripid() to handle strings ending in more than
+ one '>'; add resolve() to handle looking up objects and names (fix
+ SF bug 586931); add a nicer error message when given a filename that
+ doesn't exist. Pretend that the docstring for non-callable objects
+ is always None; this makes for less confusing output and fixes the
+ problem reported in SF patch 550290. Change the way 'less' is
+ invoked as a browser (on Unix) to make it more robust.
+- In pickle.py: Whichmodule() now skips dummy (None) package entries
+ in sys.modules. Try the persistent id code *before* calling
+- A variety of fixes were applied to the compiler package.
+- In distutils/: Fix distutils.sysconfig to understand that the
+ running Python is part of the build tree and needs to use the
+ appropriate "shape" of the tree [SF patch 547734]. Prefer rpmbuild
+ over rpm if available [SF patch 619493]. util.convert_path()
+ failed with empty pathname. [SF bug 574235]
+- In posixpath.py and user.py: fixed SF bug 555779, "import user
+ doesn't work with CGIs."
+- In site.py: fixed a problem which triggered when sys.path was empty.
+- In smtpd.py: print the refused list to the DEBUGSTREAM [SF 515021];
+ removed an embarrassing debug line from smtp_RCPT().
+- In smtplib.py: fix multiline string in sendmail example [SF patch
+ 586999]; handle empty addresses [SF bug 602029].
+- In urllib.py: treat file://localhost/ as local too (same as file:/
+ and file:///). [SF bug 607789]
+- In warnings.py: ignore IOError when writing the message.
+- In ConfigParser.py: allow internal whitespace in keys [SF bug
+ 583248]; use option name transform consistently in has_option() [SF
+ bug 561822]; misc other patches.
+- In sre_compile.py (the compile() function for the re module):
+ Disable big charsets in UCS-4 builds. [SF bug 599377]
+- In pre.py (the deprecated, *old* implementation of the re module):
+ fix broken sub() and subn(). [SF bug 570057]
+- In weakref.py: The WeakKeyDictionary constructor didn't work when a
+ dict arg was given. [SF patch 564549]
+- In xml/: various fixes tracking PyXML.
+- In urllib2.py: fix proxy config with user+pass authentication. [SF
+- In pdb.py: Increase the maxstring value of _saferepr. Add exit as
+ an alias for quit [SF bug 543674]. Fix crash on input line
+ consisting of one or more spaces [SF bug 579701].
+- In test/regrtest.py: added some sys.stdout.flush() calls.
+ - Deprecate (in comment) cunifvariate(). [SF bug 506647]
+ - Loosened the acceptable 'start' and 'stop' arguments to
+ randrange() so that any Python (bounded) ints can be used. So,
+ e.g., randrange(-sys.maxint-1, sys.maxint) no longer blows up.
+ - The gauss() method uses a piece of hidden state used by nothing
+ else, and the .seed() and .whseed() methods failed to reset it.
+ In other words, setting the seed didn't completely determine the
+ sequence of results produced by random.gauss(). It does now.
+ Programs repeatedly mixing calls to a seed method with calls to
+ gauss() may see different results now.
+ - The randint() method is rehabilitated (i.e. no longer deprecated).
+- In copy.py: when an object is copied through its __reduce__ method,
+ there was no check for a __setstate__ method on the result [SF
+ patch 565085]; deepcopy should treat instances of custom
+ metaclasses the same way it treats instances of type 'type' [SF
+- In turtle.py: update canvas before computing width; draw turtle when
+ done drawing circle. [SF bug 612595]
+- In Tkinter.py: Canvas.select_item() now returns the selected item,
+ if any. [SF patch 581396]
+- In multifile.py: *backed out* the change that stripped a trailing
+ \r\n. This caused more problems than it fixed. [SF bug 514676]
+- In rexec.py: fixed several security problems. *This does not mean
+ that rexec is now considered safe!*
+- In os.py: security fixes for _execvpe().
+- In gzip.py: open files in binary mode.
+- In CGIHTTPServer.py: update os.environ regardless of hos it tries to
+ handle calls (fork, popen*, etc.). Also fixed a flush() of a
+ read-only file (can't do that on MacOS X).
+- In urllib.py: in splituser(), allow @ in the userinfo field. This
+ is not allowed by RFC 2396; however, other tools support unescaped
+ @'s so we should also. [SF patch 596581, bug 581529]
+- In base64.py: decodestring('') should return '' instead of raising
+ an exception. [SF bug 595671]
+- atexit.py: keep working if sys.exitfunc is already set when this is
+- In copy.py: Make sure that *any* object whose id() is used as a memo
+ key is kept alive in the memo. [SF bug 592567]
+- In httplib.py: fixed a variety of bugs. The httplib.py in Python
+ 2.2.2 is identical to that in the CVS head (at the time of the
+- In rfc822.py: change the default for Message.get() back to None.
+- In bdb.py: fix an old bug that made it impossible to continue after
+ hitting a breakpoint while in the bottom frame.
+- In Queue.py: use try/finally to ensure that all locks are properly
+ released. [SF bug 544473]
+- In SocketServer.py: the correct initialization of self.wfile is
+ StringIO.StringIO(), not StringIO.StringIO(self.packet). [SF bug
+- Various platform-specific problems were fixed, including most open
+ 64-bit platform specific issues.
+- Updated Misc/RPM for Python 2.2.2b1; added Makefile.pre.in to -devel.
- The fpectl module is not built by default; it's dangerous or useless
- except in the hands of experts.
+ except in the hands of experts. (At the same time, a fix for DEC
+ Alpha under Linux was applied.)
+- Better check for C++ linkage. [SF bug 559429]
+- The errno module needs to be statically linked, since it is now
+ needed during the extension building phase.
- A bug was fixed that could cause COUNT_ALLOCS builds to segfault, or
get into infinite loops, when a new-style class got garbage-collected.
that new-style classes be immortal in COUNT_ALLOCS builds. Note that
COUNT_ALLOCS is not enabled by default, in either release or debug
builds, and that new-style classes are immortal only in COUNT_ALLOCS
- builds. SourceForge bug 578752.
+ builds. [SF bug 578752]
+- In order to avoid problems with binutils 2.12 and later, test for
+ --export-dynamic in its help output.
+- Improve handling of ^C on Windows. [SF bug 439992]
+- Provide a fallback version of ntpath.abspath() when the nt module
+- Fixed asyncore on Windows to avoid calling select() with three empty
+ lists. Use time.sleep() instead, to match what happens on
+ Unix/Linux in that case. [SF item 611464]
+- Fixed selectmodule.c to call WSAGetLastError() to retrieve the error
+- Fixed the test for mmap so that it passes on Windows too.
- SF bug 595919: popenN return only text mode pipes
popen2() and popen3() created text-mode pipes even when binary mode
was asked for. This was specific to Windows.
of that has been fixed in the installer (disabled Wise's "delete in-
use files" uninstall option).
+- Most changes to IDLE were backported, including some featurettes.
What's New in Python 2.2.1 final?
Release date: 10-Apr-2002