Backport improvements to set.py so that the interface will remain
consistent across versions.
* Relaxed the argument restrictions for non-operator methods. They now
allow any iterable instead of requiring a set. This makes the module
a little easier to use and paves the way for an efficient C
implementation which can take better advantage of iterable arguments
while screening out immutables.
* Added a PendingDeprecationWarning for Set.update() because it now
duplicates Set.union_update()
* Adapted the tests and docs to include the above changes.
* Added more test coverage including testing identities and checking
to make sure non-restartable generators work as arguments.
Walter Dörwald [Thu, 14 Aug 2003 21:00:28 +0000 (21:00 +0000)]
Backport checkin:
Fix refcount leak in the UnicodeError constructor:
When parsing the constructor arguments failed, a
reference to the argument tuple was leaked.
Walter Dörwald [Thu, 14 Aug 2003 20:26:44 +0000 (20:26 +0000)]
Backport checkins:
Fix refcount leak in PyUnicode_EncodeCharmap(). The bug surfaces
when an encoding error occurs and the callback name is unknown,
i.e. when the callback has to be called. The problem was that
the fact that the callback has already been looked up was only
recorded in a local variable in charmap_encoding_error(), because
charmap_encoding_error() got it's own copy of the errorHandler
pointer instead of a pointer to the pointer in
PyUnicode_EncodeCharmap().
Walter Dörwald [Tue, 12 Aug 2003 17:38:22 +0000 (17:38 +0000)]
Backport checkins:
* Enhance message for UnicodeEncodeError and UnicodeTranslateError.
If there is only one bad character it will now be printed in a
form that is a valid Python string.
* Add a unicode prefix to the characters in the UnicodeEncodeError
and UnicodeTranslateError message.
The default seed is time.time().
Multiplied by 256 before truncating so that fractional seconds are used.
This way, two consequetive calls to random.seed() are much more likely
to produce different sequences.
Brett Cannon [Wed, 6 Aug 2003 21:17:09 +0000 (21:17 +0000)]
Re-introduction of caching. Not thread-safe against the changing of locale
in the middle of executing time.strptime . Added new tests for caching
mechanism; taken from 2.4 branch and tweaked appropriately.
Backport SF bug #782369: Massive memory leak in array module
Fixed leak caused by switching from PyList_GetItem to PySequence_GetItem.
Added missing NULL check.
Clarified code by converting an "if" to an "else if".
Tim Peters [Tue, 29 Jul 2003 17:22:57 +0000 (17:22 +0000)]
SF bug 778400: IDLE hangs when selecting "Edit with IDLE".
The fix is confined to the Windows installer.
Not a bugfix candidate: the need for the new -n switch added here was
introduced by moving to the idlefork IDLE (so this change isn't needed
or helpful before 2.3).
Kurt B. Kaiser [Sun, 27 Jul 2003 03:24:19 +0000 (03:24 +0000)]
Added a banner to the shell startup message discussing possible
warnings from personal firewall software. Added the same text
to README.txt, updated NEWS.txt for release.
Jack Jansen [Thu, 24 Jul 2003 22:25:03 +0000 (22:25 +0000)]
Don't export the SPB type as "SPB", because it shadows the method SPB,
which is really important. This is a stopgap measure, as only the generated
C code is adapted. Fixes #776533.
Fixes bug of having default argument for TimeRE's __init__ that caused the
LocaleTime instance to only be created once and thus not be recreated when
the locale changed.
Remove caching of TimeRE (and thus LocaleTime) instance. Error was being
caught when executing test_strptime, test_logging, and test_time in that order
when the testing of "%c" occured. Suspect the cache was not being recreated
(the test passed when test_logging was forced to re-establish the locale).
Kurt B. Kaiser [Wed, 23 Jul 2003 15:42:14 +0000 (15:42 +0000)]
1. Python Bug 775541: Calltips error when docstring is None. Introduced
by patch 769142. Fixed by patch 776062. KBK will backport net result
to IDLE release22-maint and IDLEfork.
2. Update NEWS.txt and idlever for release.
Jack Jansen [Wed, 23 Jul 2003 10:51:55 +0000 (10:51 +0000)]
Don't force boot-disk-only install, for reasons unknown it causes more
problems than it solves. In stead, put a warning near the top of the
welcome message. Fixes (or, rather works around) bug #764975.
Jack Jansen [Wed, 23 Jul 2003 10:49:17 +0000 (10:49 +0000)]
Scripts runs with pythonw no longer had full window manager access due
to the name change of Python.app/Contents/MacOS/python to
Python.app/Contents/MacOS/Python. Fixes #776116.
Tim Peters [Wed, 23 Jul 2003 00:30:11 +0000 (00:30 +0000)]
locale-restoration code: Don't leave comparison to None implicit. For
all I know, the original locale may be '' (I don't think that's possible,
but ...), and if so we would certainly want to restore it.
Tim Peters [Wed, 23 Jul 2003 00:05:07 +0000 (00:05 +0000)]
Fred wasn't kidding -- there really are docs for the locale module <wink>.
Obtain the original locale in the documented way. This way actually
works for me.
Restore the original locale at the end, instead of forcing to "C".
Move the locale fiddling into the test driver instead of doing it as a
side effect of merely importing the module. I don't know why the test
is mucking with locale (and also added a comment saying so), but it
surely has no justification for doing that as an import side-effect.
Now whenever the locale-changing code executes, the locale-restoring code
will also get run.
Thomas Heller [Tue, 22 Jul 2003 18:10:15 +0000 (18:10 +0000)]
Change the zipimport implementation to accept files containing
arbitrary bytes before the actual zip compatible archive. Zipfiles
containing comments at the end of the file are still not supported.
Add a testcase to test_zipimport, and update NEWS.
Cygwin's pthread_sigmask() implementation appears to be buggy. This
patch works around this problem by using sigprocmask() instead.
This patch is implemented in a general way so it could be used by other
platforms too. If this approach is deemed too risky, then I can work up
a patch that just hacks Python/thread_pthread.h for Cygwin.
Note that I tested this patch against 2.3c1 under Red Hat Linux 8.0 too.
[snip]
And finally, I need someone to regenerate pyconfig.h.in and configure
with the same versions of the autotools that are normally used by
Python.
Neal kindly regenerated pyconfig.h.in and configure for me.