Jack Jansen [Mon, 10 Feb 2003 14:19:14 +0000 (14:19 +0000)]
- Better exception when the database isn't found.
- Allow for "manual:" pseudo-scheme in downloadURL to signal that
the download should be done manually.
Jack Jansen [Mon, 10 Feb 2003 14:02:33 +0000 (14:02 +0000)]
Pick up Makefile variable BASECFLAGS too. This is needed since OPT was
split into OPT and BASECFLAGS (Makefile.pre.in rev. 1.108), because
now there are essential CFLAGS in BASECFLAGS.
Walter Dörwald [Mon, 10 Feb 2003 13:19:13 +0000 (13:19 +0000)]
Change filterstring() and filterunicode(): If the
object is not a real str or unicode but an instance
of a subclass, construct the output via looping
over __getitem__. This guarantees that the result
is the same for function==None and function==lambda x:x
This doesn't happen for tuples, because filtertuple()
uses PyTuple_GetItem().
Just van Rossum [Mon, 10 Feb 2003 09:22:01 +0000 (09:22 +0000)]
My previous checkin caused compile() to no longer accept buffers, as noted
my MAL. Fixed. (Btw. eval() still doesn't take buffers, but that was so
even before my patch.)
Jack Jansen [Sun, 9 Feb 2003 23:10:20 +0000 (23:10 +0000)]
Strawman for a Package Install Manager for Python. It isn't CPAN yet, but at
less than 500 lines it already manages to test whether Numeric is installed,
and can install it if it isn't, including any prerequisites.
C Code:
* Removed the ifilter flag wart by splitting it into two simpler functions.
* Fixed comment tabbing in C code.
* Factored module start-up code into a loop.
Documentation:
* Re-wrote introduction.
* Addede examples for quantifiers.
* Simplified python equivalent for islice().
* Documented split of ifilter().
Tim Peters [Sat, 8 Feb 2003 03:46:31 +0000 (03:46 +0000)]
The Python implementation of datetime was changed in ways that no longer
tickle the 2.2.2 __cmp__ bug test_datetime used to tickle, so the
workarounds for that bug no longer make sense in the test suite (which I'm
still trying to keep as closely in synch as possible with Zope3's
version).
Tim Peters [Fri, 7 Feb 2003 22:50:28 +0000 (22:50 +0000)]
Comparison for timedelta, time, date and datetime objects: __eq__ and
__ne__ no longer complain if they don't know how to compare to the other
thing. If no meaningful way to compare is known, saying "not equal" is
sensible. This allows things like
if adatetime in some_sequence:
and
somedict[adatetime] = whatever
to work as expected even if some_sequence contains non-datetime objects,
or somedict non-datetime keys, because they only call __eq__.
It still complains (raises TypeError) for mixed-type comparisons in
contexts that require a total ordering, such as list.sort(), use as a
key in a BTree-based data structure, and cmp().
Somehow, copy() of a classic class object was handled
atomically, but deepcopy() didn't support this at all.
I don't see any reason for this, so I'm adding ClassType
to the set of types that are deep-copied atomically.
Jack Jansen [Fri, 7 Feb 2003 15:45:40 +0000 (15:45 +0000)]
Made AskFile* dialogs movable-modal by default, by providing a dummy
eventProc (which simply drops all events on the floor). Also added a
method SetDefaultEventProc through which frameworks can set a global
event handler (which can still be overridden on a per-call basis
with the eventProc argument).
* Eliminated tuple re-use in imap(). Doing it correctly made the code
too hard to read.
* Simplified previous changes to izip() to make it easier to read.
* Fixed typo in exception message for times()
* Filled in missing times_traverse()
* Document reasons that imap() did not adopt a None fill-in feature
* Document that count(sys.maxint) will wrap-around on overflow
* Add overflow test to islice()
* Check that starmap()'s argument returns a tuple
* Verify that imap()'s tuple re-use is safe
* Make a similar tuple re-use (with safety check) for izip()
Tim Peters [Fri, 7 Feb 2003 01:53:46 +0000 (01:53 +0000)]
SF bug 666444: 'help' makes linefeed only under Win32.
Reverting one of those irritating "security fixes". fdopen() opens
files in binary mode. That makes pydoc skip the \r\n on Windows that's
need to make the output readable in the shell. Screw it.
A few naughty external scripts do 'raise getopt.error, "blah"', and
now crash because two arguments are expected. Add a default value
to keep those scripts running.
Add test suite for filecmp.py, after some discussion on bug #680494.
Right now the test cases create a files and a directory in the temp.
directory. Raymond suggested checking files in to the test/ directory,
simplifying the setup/teardown methods; is that worth doing?
Tim Peters [Thu, 6 Feb 2003 16:42:14 +0000 (16:42 +0000)]
SF bug 680864: test_datetime fails for non-unix epoch
Apparently MAC OS 9 doesn't have POSIX-conforming timestamps. A test
fails as a result, but at least for this specific test it's easy enough
to get the POSIX epoch out of it.
Anthony Baxter [Thu, 6 Feb 2003 01:45:11 +0000 (01:45 +0000)]
Updated version of [ 558544 ] cmd.py: add instance-specific stdin/out
This patch adds stdin, stdout as optional arguments to the cmd.Cmd
constructor (defaulting to sys.stdin, sys.stdout), and changes the Cmd
methods throughout to use self.stdout.write() and self.stdin.foo for
output and input. This allows much greater flexibility for using cmd -
for instance, hooking it into a telnet server.
Jeremy Hylton [Wed, 5 Feb 2003 23:13:00 +0000 (23:13 +0000)]
Small function call optimization and special build option for call stats.
-DCALL_PROFILE: Count the number of function calls executed.
When this symbol is defined, the ceval mainloop and helper functions
count the number of function calls made. It keeps detailed statistics
about what kind of object was called and whether the call hit any of
the special fast paths in the code.
Optimization:
When we take the fast_function() path, which seems to be taken for
most function calls, and there is minimal frame setup to do, avoid
call PyEval_EvalCodeEx(). The eval code ex function does a lot of
work to handle keywords args and star args, free variables,
generators, etc. The inlined version simply allocates the frame and
copies the arguments values into the frame.
The optimization gets a little help from compile.c which adds a
CO_NOFREE flag to code objects that don't have free variables or cell
variables. This change allows fast_function() to get into the fast
path with fewer tests.
I measure a couple of percent speedup in pystone with this change, but
there's surely more that can be done.
Jeremy Hylton [Wed, 5 Feb 2003 22:39:29 +0000 (22:39 +0000)]
Refactor the logic for setting f_builtins.
For the case where the current globals match the previous frame's
globals, eliminates three tests in two if statements. For the case
where we just get __builtins__ from a module, eliminate a couple of
tests.
[Patch #654421 from Matthew Mueller]
gzip shouldn't raise ValueError on corrupt files
Currently the gzip module will raise a ValueError if the file was
corrupt (bad crc or bad size). I can't see how that applies to
reading a corrupt file. IOError seems better, and it's what code
will likely be looking for.
Tim Peters [Wed, 5 Feb 2003 19:55:53 +0000 (19:55 +0000)]
dis(): Added an optional memo argument, so that multiple pickles in a
file can be dumped without (bogus) complaint if the the pickles were
created using a single pickle memo.
Jason Tishler [Wed, 5 Feb 2003 15:16:17 +0000 (15:16 +0000)]
This patch reverts the following:
It also prevents building against the real X headers, if installed.
After discussions with the Cygwin project lead, I believe that building
against the real X headers is OK. Especially, since the psuedo-X headers
are *not* installed by the Cygwin Tcl/Tk binary package.
Jason Tishler [Wed, 5 Feb 2003 15:06:46 +0000 (15:06 +0000)]
This patch enables Cygwin Python to build _tkinter against Tcl/Tk 8.4.
Note that this patch just reverts the lib_prefix (i.e., "cyg") portion
of my Tcl/Tk 8.3 patch. It seems that Cygwin Tcl/Tk is using a more
normal file naming convention again.