Commit graph

11129 commits

Author SHA1 Message Date
Tim Peters
c27d655c00 dash_R_cleanup(): Clear filecmp._cache. This accounts for
different results across -R runs (at least on Windows) of
test_filecmp.
2006-06-07 01:04:59 +00:00
Thomas Heller
56dab85022 Specify argtypes for all test functions. Maybe that helps on strange ;-) architectures 2006-06-06 15:34:18 +00:00
Martin Blais
215f13dd11 Normalized a few cases of whitespace in function declarations.
Found them using::

  find . -name '*.py' | while read i ; do grep 'def[^(]*( ' $i /dev/null ; done
  find . -name '*.py' | while read i ; do grep ' ):' $i /dev/null ; done

(I was doing this all over my own code anyway, because I'd been using spaces in
all defs, so I thought I'd make a run on the Python code as well.  If you need
to do such fixes in your own code, you can use xx-rename or parenregu.el within
emacs.)
2006-06-06 12:46:55 +00:00
Thomas Heller
ecc3e67b98 Convert CFieldObject tp_members to tp_getset, since there is no
structmember typecode for Py_ssize_t fields.  This should fix some of
the errors on the PPC64 debian machine (64-bit, big endian).

Assigning to readonly fields now raises AttributeError instead of
TypeError, so the testcase has to be changed as well.
2006-06-06 11:34:33 +00:00
Tim Peters
c169e9f19c Add missing svn:eol-style property to text files. 2006-06-05 20:49:27 +00:00
Tim Peters
852eae1bc1 Access _struct attributes directly instead of mucking with getattr.
string_reverse():  Simplify.

assertRaises():  Raise TestFailed on failure.

test_unpack_from(), test_pack_into(), test_pack_into_fn():  never
use `assert` to test for an expected result (it doesn't test anything
when Python is run with -O).
2006-06-05 20:48:49 +00:00
Gregory P. Smith
372b583a6b * fix DBCursor.pget() bug with keyword argument names when no data= is
supplied [SF pybsddb bug #1477863]
2006-06-05 18:48:21 +00:00
Tim Peters
d6024d30c6 Whitespace normalization. 2006-06-05 18:36:12 +00:00
Gregory P. Smith
9d7a69caa9 forgot to add this file in previous commit 2006-06-05 18:20:07 +00:00
Gregory P. Smith
f0547d0d3e * add support for DBSequence objects [patch #1466734] 2006-06-05 17:38:04 +00:00
Gregory P. Smith
db8a80735b * support DBEnv.lsn_reset() method on BerkeleyDB >= 4.4 [patch #1494902] 2006-06-05 01:56:15 +00:00
Tim Peters
7140de01cf Whitespace normalization. 2006-06-05 01:47:24 +00:00
Tim Peters
bf0400abe9 Remove doctest.testmod's deprecated (in 2.4) isprivate
argument.  A lot of hair went into supporting that!
2006-06-05 01:43:03 +00:00
Gregory P. Smith
76a82e89ab * support DBEnv.log_stat() method on BerkeleyDB >= 4.0 [patch #1494885] 2006-06-05 01:39:52 +00:00
Tim Peters
06c5c00819 "Flat is better than nested."
Move the long-winded, multiply-nested -R support out
of runtest() and into some module-level helper functions.
This makes runtest() and the -R code easier to follow.
That in turn allowed seeing some opportunities for code
simplification, and made it obvious that reglog.txt
never got closed.
2006-06-05 00:55:26 +00:00
Gregory P. Smith
3dd20022ac bugfix: when log_archive was called with the DB_ARCH_REMOVE flag present
in BerkeleyDB >= 4.2 it tried to construct a list out of an uninitialized
char **log_list.

feature: export the DB_ARCH_REMOVE flag by name in the module on BerkeleyDB >= 4.2.
2006-06-05 00:31:01 +00:00
Tim Peters
28eeefe566 Revert revisions:
46640 Patch #1454481:  Make thread stack size runtime tunable.
46647 Markup fix

The first is causing many buildbots to fail test runs, and there
are multiple causes with seemingly no immediate prospects for
repairing them.  See python-dev discussion.

Note that a branch can (and should) be created for resolving these
problems, like

svn copy svn+ssh://svn.python.org/python/trunk -r46640 svn+ssh://svn.python.org/python/branches/NEW_BRANCH

followed by merging rev 46647 to the new branch.
2006-06-04 23:52:47 +00:00
Tim Peters
c7d14452a4 Whitespace normalization. 2006-06-04 23:43:53 +00:00
Georg Brandl
ad62489e47 Bug #1500293: fix memory leaks in _subprocess module. 2006-06-04 22:15:37 +00:00
Georg Brandl
ddbaa660d3 Patch #1346214: correctly optimize away "if 0"-style stmts
(thanks to Neal for review)
2006-06-04 21:56:52 +00:00
Martin v. Löwis
3f767795f6 Patch #1359618: Speed-up charmap encoder. 2006-06-04 19:36:28 +00:00
Ronald Oussoren
fb2a169ce3 Drop Mac wrappers for the WASTE library. 2006-06-04 14:24:59 +00:00
Martin Blais
af2ae72cb2 Fixes in struct and socket from merge reviews.
- Following Guido's comments, renamed

  * pack_to -> pack_into
  * recv_buf -> recv_into
  * recvfrom_buf -> recvfrom_into

- Made fixes to _struct.c according to Neal Norwitz comments on the checkins
  list.

- Converted some ints into the appropriate -- I hope -- ssize_t and size_t.
2006-06-04 13:49:49 +00:00
Andrew MacIntyre
6539d2d3c7 Patch #1454481: Make thread stack size runtime tunable. 2006-06-04 12:31:09 +00:00
Tim Peters
c65a13f53b Whitespace normalization. 2006-06-04 01:22:53 +00:00
Tim Peters
d609b1a20e pprint functions used to sort a dict (by key) if and only if
the output required more than one line.  "Small" dicts got
displayed in seemingly random order (the hash-induced order
produced by dict.__repr__).  None of this was documented.
Now pprint functions always sort dicts by key, and the docs
promise it.

This was proposed and agreed to during the PyCon 2006 core
sprint -- I just didn't have time for it before now.
2006-06-02 23:22:51 +00:00
Martin Blais
7f7386cfd2 Fixed struct test to not use unittest. 2006-06-02 13:03:43 +00:00
Neal Norwitz
38d4d4a35b Fix memory leak found by valgrind. 2006-06-02 04:50:49 +00:00
Neal Norwitz
e152aab977 Convert docstrings to comments so regrtest -v prints method names 2006-06-02 04:45:53 +00:00
Tim Peters
80a18f0f9c Re-enable a new empty-string test added during the NFS sprint,
but disabled then because str and unicode strings gave different
results.  The implementations were repaired later during the
sprint, but the new test remained disabled.
2006-06-01 13:56:26 +00:00
Tim Peters
5535da0303 Whitespace normalization. 2006-06-01 13:41:46 +00:00
Armin Rigo
35f6d36951 [ 1497053 ] Let dicts propagate the exceptions in user __eq__().
[ 1456209 ] dictresize() vulnerability ( <- backport candidate ).
2006-06-01 13:19:12 +00:00
Georg Brandl
e08940ef6c Some code style tweaks, and remove apply. 2006-06-01 13:00:49 +00:00
Georg Brandl
b9120e772b Correctly dispatch Faults in loads (patch #1498627) 2006-06-01 12:30:46 +00:00
Andrew M. Kuchling
622f144175 [Bug #1473048]
SimpleXMLRPCServer and DocXMLRPCServer don't look at
the path of the HTTP request at all; you can POST or
GET from / or /RPC2 or /blahblahblah with the same results.
Security scanners that look for /cgi-bin/phf will therefore report
lots of vulnerabilities.

Fix: add a .rpc_paths attribute to the SimpleXMLRPCServer class,
and report a 404 error if the path isn't on the allowed list.

Possibly-controversial aspect of this change: the default makes only
'/' and '/RPC2' legal.  Maybe this will break people's applications
(though I doubt it).  We could just set the default to an empty tuple,
which would exactly match the current behaviour.
2006-05-31 14:08:48 +00:00
Neal Norwitz
9f16dd026c On 64-bit platforms running test_struct after test_tarfile would fail
since the deprecation warning wouldn't be raised.
2006-05-31 09:02:44 +00:00
Tim Peters
dd55b0a32c Whitespace normalization. 2006-05-30 23:28:02 +00:00
Fredrik Lundh
9e9ef9fa5a changed count to return 0 for slices outside the source string 2006-05-30 17:39:58 +00:00
Bob Ippolito
4182a75571 Change wrapping terminology to overflow masking 2006-05-30 17:37:54 +00:00
Fredrik Lundh
93eff6fecd changed find/rfind to return -1 for matches outside the source string 2006-05-30 17:11:48 +00:00
Georg Brandl
cdcede62c0 Convert test_exceptions to unittest. 2006-05-30 08:47:19 +00:00
Georg Brandl
b0432bc032 Do the check for no keyword arguments in __init__ so that
subclasses of Exception can be supplied keyword args
2006-05-30 08:17:00 +00:00
Georg Brandl
861089fc49 Disallow keyword args for exceptions. 2006-05-30 07:34:45 +00:00
Neal Norwitz
008b861bf0 Don't fail if the (sub)pkgname already exist. 2006-05-30 07:21:10 +00:00
Georg Brandl
05f97bffac Add a test case for exception pickling. args is never NULL. 2006-05-30 07:13:29 +00:00
Tim Peters
27c70598a8 Whitespace normalization. 2006-05-30 02:26:46 +00:00
Tim Peters
aba19bc45f deprecated_err(): Stop bizarre warning messages when the tests
are run in the order:

    test_genexps (or any other doctest-based test)
    test_struct
    test_doctest

The `warnings` module needs an advertised way to save/restore
its internal filter list.
2006-05-30 02:25:25 +00:00
Bob Ippolito
6067f20172 Add a length check to aifc to ensure it doesn't write a bogus file 2006-05-30 00:26:01 +00:00
Bob Ippolito
2fd3977a9d struct: modulo math plus warning on all endian-explicit formats for compatibility with older struct usage (ugly) 2006-05-29 22:55:48 +00:00
Fredrik Lundh
b51b470eb8 fixed "abc".count("", 100) == -96 error (hopefully, nobody's relying on
the current behaviour ;-)
2006-05-29 22:42:07 +00:00