Commit Graph

7647 Commits

Author SHA1 Message Date
Jack Jansen 6a600aba2d Added docstrings. 2003-02-10 15:55:51 +00:00
Jack Jansen 26bf3acf42 - Better exception when the database isn't found.
- Allow for "manual:" pseudo-scheme in downloadURL to signal that
  the download should be done manually.
2003-02-10 14:19:14 +00:00
Jack Jansen 4f82a513ca 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.
2003-02-10 14:02:33 +00:00
Jack Jansen c4b217dd18 Use MD5 checksums to check archive integrity and forestall downloads. 2003-02-10 13:38:44 +00:00
Walter Dörwald 1918f7755e 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().

(This was discussed on SF bug #665835).
2003-02-10 13:19:13 +00:00
Jack Jansen b4bb64e288 Added preInstall and postInstall commands to packages. PIL needs this
(preInstall, at least).
2003-02-10 13:08:04 +00:00
Just van Rossum 3aaf42c613 patch #683515: "Add unicode support to compile(), eval() and exec"
Incorporated nnorwitz's comment re. Py__USING_UNICODE.
2003-02-10 08:21:10 +00:00
Neal Norwitz de8b94c3e1 Fix SF bug #683467, 'int' ability to generate longs not inherited
When subclassing from an int but not overriding __new__,
long values were not converted properly.  Try to convert
longs into an int.
2003-02-10 02:12:43 +00:00
Neal Norwitz 9caf9c040e Add tests and news entry about parser errors from bug #678518. 2003-02-10 01:54:06 +00:00
Jack Jansen 95839b8af9 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.
2003-02-09 23:10:20 +00:00
Just van Rossum f032f86e9e patch 680474 that fixes bug 679880: compile/eval/exec refused utf-8 bom
mark. Added unit test.
2003-02-09 20:38:48 +00:00
Guido van Rossum cf117b0b40 Rename 'proto' keyword arg to 'protocol' . Greg Ward's suggestion. 2003-02-09 17:19:41 +00:00
Raymond Hettinger 60eca9331a 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().

Sets.py:
* Replace old ifilter() usage with new.
2003-02-09 06:40:58 +00:00
Tim Peters 68124bb771 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).
2003-02-08 03:46:31 +00:00
Barry Warsaw 9914227caa Fix compatibility for earlier versions of Python (than 2.3), which
doesn't have UserDict.DictMixin.
2003-02-08 03:18:58 +00:00
Tim Peters 07534a607b 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().
2003-02-07 22:50:28 +00:00
Guido van Rossum 275666fd50 Merge the test part of the below checkin to the sandbox and Zope3, so
the tests will remain in sync:

"""
Tres discovered a weird bug when a datetime is pickled, caused by the
shadowing of __year, __month, __day and the use of proxies.

Here's a quick fix and a quick unit test.  I don't quite understand
why this wasn't caught by the pickling unit tests.
"""
2003-02-07 21:49:01 +00:00
Guido van Rossum cef9db6db5 Reserve a range for Zope, not specifically for Zope 3. 2003-02-07 20:56:38 +00:00
Neal Norwitz f98159c376 Fix SF bug #642168, help() fails for some builtin topics
Fix pydoc when doing help for:  and, or, not, UNICODE.

Will backport.
2003-02-07 20:49:40 +00:00
Guido van Rossum 1dca482dbd 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.
2003-02-07 17:53:23 +00:00
Guido van Rossum c06e3acc73 Add support for copy_reg.dispatch_table.
Rewrote copy() and deepcopy() without avoidable try/except statements;
getattr(x, name, None) or dict.get() are much faster than try/except.
2003-02-07 17:30:18 +00:00
Jack Jansen 2731c5cf46 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).
2003-02-07 15:45:40 +00:00
Guido van Rossum f631859409 Add __getnewargs__ method to classes that need it.
(Yes, this is an incompatibility.  I'll document it in PEP 307.)
2003-02-07 14:59:13 +00:00
Raymond Hettinger 2012f174ea SF bug #681003: itertools issues
* 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()
2003-02-07 05:32:58 +00:00
Tim Peters 550e4e5583 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.
2003-02-07 01:53:46 +00:00
Jack Jansen caaad98ebd Got rid of macfs and FSSpecs. 2003-02-06 23:12:23 +00:00
Guido van Rossum 5aac4e6312 Move _better_reduce from copy.py to copy_reg.py, and also use it in
pickle.py, where it makes save_newobj() unnecessary.  Tests pass.
2003-02-06 22:57:00 +00:00
Guido van Rossum 85233bf746 Fix a bug in the way __getnewargs__ was handled. 2003-02-06 21:25:12 +00:00
Guido van Rossum c755758906 Support all the new stuff supported by the new pickle code:
- subclasses of list or dict
- __reduce__ returning a 4-tuple or 5-tuple
- slots
2003-02-06 19:53:22 +00:00
Andrew M. Kuchling 0189266456 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.
2003-02-06 19:52:56 +00:00
Andrew M. Kuchling 83e879d99f Add DeprecationWarning when use_statcache argument is supplied
Fix use of GetoptError, so demo() now works
2003-02-06 19:38:45 +00:00
Guido van Rossum 98b922c0ec Remove a debug print statement. 2003-02-06 19:30:38 +00:00
Guido van Rossum 90e05b0e25 Support __reduce__ returning a 4-tuple or 5-tuple. 2003-02-06 18:18:23 +00:00
Guido van Rossum 581cb938d0 A test suite for the copy module. This should provide full code
coverage.
2003-02-06 17:52:15 +00:00
Andrew M. Kuchling 8eb4044f7e [Bug #680494] filecmp.py uses obsolete statcache module.
Simply replace all uses of statcache with os.stat.

Should I add a DeprecationWarning triggered if the use_statcache argument
is supplied, so we can remove it in 2.4?
2003-02-06 17:50:01 +00:00
Andrew M. Kuchling e63846dc3a 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?
2003-02-06 17:42:45 +00:00
Tim Peters 844076122e 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.
2003-02-06 16:42:14 +00:00
Jeremy Hylton cc1fccbc1c No need for a continuation line. 2003-02-06 16:23:01 +00:00
Jeremy Hylton 656d4519b5 Replace hasattr() + getattr() with single getattr() and default value. 2003-02-06 16:22:01 +00:00
Anthony Baxter 983b008824 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.

Patch for library module and for documentation.
2003-02-06 01:45:11 +00:00
Andrew M. Kuchling 64edd6ac1d [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.
2003-02-05 21:35:07 +00:00
Tim Peters 62235e701e 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.
2003-02-05 19:55:53 +00:00
Tim Peters 6ee0480521 [680789] Debug with long array takes forever
Added array.array to the types repr.py knows about, after a suggestion
from Jurjen N.E. Bos.
2003-02-05 18:29:34 +00:00
Jason Tishler 5c4ded2c3b Patch #551977: Regression exceptions for cygwin
Applied the skip test_ossaudiodev patch.
2003-02-05 16:46:01 +00:00
Jack Jansen cf0b2e8e28 Getting rid of macfs and FSSpecs. 2003-02-05 15:49:19 +00:00
Jack Jansen d66071b48d Got rid of macfs 2003-02-05 15:44:03 +00:00
Jack Jansen 769e1ff4a1 Fixed a few typos, and changed FSCreateResourceFile filename argument to unicode. 2003-02-05 13:39:04 +00:00
Jack Jansen b86a2e8036 Use os.path.realpath() in stead of abspath(), so the tests don't fail if
we have a symlink somewhere in the TESTFN path.
2003-02-05 11:14:16 +00:00
Raymond Hettinger 30a634e0a9 SF patch #674396: Apply UserDict.DictMixin to expand dbshelve and dbojb
to have a full dictionary interface.
2003-02-05 04:12:41 +00:00
Tim Peters 35ad641b99 Build pickler_choices list in a lazier way. 2003-02-05 04:08:07 +00:00