Commit Graph

26275 Commits

Author SHA1 Message Date
Andrew M. Kuchling d683504b85 Use new name for GetoptError, and pass it two arguments
Use re module instead of regex
2003-02-06 19:55:35 +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
Michael W. Hudson 241c2e9692 Remove another lie. 2003-02-06 18:38:11 +00:00
Michael W. Hudson 847f37543f Correct lie about METH_NOARGS functions.
Backport candidate.
2003-02-06 18:37:11 +00:00
Guido van Rossum 90e05b0e25 Support __reduce__ returning a 4-tuple or 5-tuple. 2003-02-06 18:18:23 +00:00
Andrew M. Kuchling 93cf58b015 Typo fixes 2003-02-06 18:04:43 +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
Guido van Rossum 26507dbc82 Clarify that __module__ applies to various type of functions. 2003-02-06 16:16:50 +00:00
Jeremy Hylton 0253d6eff1 Add news item about __module__ attribute on functions. 2003-02-06 16:00:15 +00:00
Andrew M. Kuchling c9172d3832 Comment typo fix 2003-02-06 15:22:49 +00:00
Andrew M. Kuchling 80fd7851ac Mention FutureWarning for large ints 2003-02-06 15:14:04 +00:00
Andrew M. Kuchling ba37524b7c Fix description of filterwarnings() parameters (error noted by Richard Jones at
http://mechanicalcat.net/cgi-bin/log/python/turning_warnings_off.html)
2003-02-06 14:38:45 +00:00
Neal Norwitz 292f56cd26 Provide version changed info 2003-02-06 05:02:39 +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
Jeremy Hylton 985eba53f5 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.
2003-02-05 23:13:00 +00:00
Jack Jansen f3f4af5521 Got rid of macfs and made a bit more OSX-friendly. 2003-02-05 23:10:46 +00:00
Just van Rossum 19e02fc67f removing old junk 2003-02-05 22:59:07 +00:00
Jack Jansen ab564eea05 Removed unused import of macfs. 2003-02-05 22:53:29 +00:00
Jack Jansen 6d8bca8cb6 I don't think this script serves a useful purpose anymore, and I can't
be bothered to fix it.
2003-02-05 22:52:16 +00:00
Guido van Rossum ce8bcd8405 Fix for SF #668433. I'm not explaining it here; ample comments are in
the code.
2003-02-05 22:39:45 +00:00
Jeremy Hylton bd5cbf866f 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.
2003-02-05 22:39:29 +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
Andrew M. Kuchling 570e35870a Markup fixes; in particular, the tables are now reasonable width 2003-02-05 21:15:38 +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 18e7083cda SF bug 681122: Built-in function dir() causes refcount leak in baseclasses.
merge_class_dict():  This was missing a decref.

Bugfix candidate.
2003-02-05 19:35:19 +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 611b9f6697 Added "Open File by Name" command which presens a filename dialog. If
the clipboard contains a filename that filename is used as the default.
2003-02-05 15:41:09 +00:00
Jack Jansen d424836f3a Cast various floats to ints so we don't get warnings. 2003-02-05 15:40:05 +00:00
Jason Tishler 9181c94e05 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.
2003-02-05 15:16:17 +00:00
Jason Tishler cccac1a163 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.
2003-02-05 15:06:46 +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 8d4f06a73a Added itertools module. 2003-02-05 13:36:50 +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
Tim Peters 6288e230d8 More typo repair. 2003-02-05 03:53:10 +00:00
Tim Peters 679201467b Typo repair. 2003-02-05 03:46:17 +00:00
Tim Peters 3e667d5452 cPickle: exempt two_tuple from GC -- it's a speed hack, and doesn't
guarantee to keep valid pointers in its slots.

tests:  Moved ExtensionSaver from test_copy_reg into pickletester, and
use it both places.  Once extension codes get assigned, it won't be
safe to overwrite them willy nilly in test suites, and ExtensionSaver
does a thorough job of undoing any possible damage.

Beefed up the EXT[124] tests a bit, to check the smallest and largest
codes in each opcode's range too.
2003-02-04 21:47:44 +00:00
Neil Schemenauer 5042da6b1e If a float is passed where a int is expected, issue a DeprecationWarning
instead of raising a TypeError.  Closes #660144 (again).
2003-02-04 20:59:40 +00:00