Commit Graph

11106 Commits

Author SHA1 Message Date
Thomas Heller 5114826950 Upgrade to ctypes version 0.9.9.7.
Summary of changes:

- support for 'variable sized' data
- support for anonymous structure/union fields
- fix severe bug with certain arrays or structures containing more than 256 fields
2006-06-10 19:55:36 +00:00
Skip Montanaro 86116e2b75 document the class, not its initializer 2006-06-10 14:09:11 +00:00
Georg Brandl 90e27d38f5 Apply perky's fix for #1503157: "/".join([u"", u""]) raising OverflowError.
Also improve error message on overflow.
2006-06-10 06:40:50 +00:00
Brett Cannon 22565aac3b An object with __call__ as an attribute, when called, will have that attribute checked for __call__ itself, and will continue to look until it finds an object without the attribute. This can lead to an infinite recursion.
Closes bug #532646, again.  Will be backported.
2006-06-09 22:31:23 +00:00
Georg Brandl b2afe855e5 Make use of new str.startswith/endswith semantics.
Occurences in email and compiler were ignored due to backwards compat requirements.
2006-06-09 20:43:48 +00:00
Andrew M. Kuchling 2007d4e892 Remove unused variable 2006-06-09 19:43:25 +00:00
Tim Peters e558486953 Implementing a happy idea from Georg Brandl: make runtest() try to
clean up files and directories the tests often leave behind by
mistake.  This is the first time in history I don't have a bogus
"db_home" directory after running the tests ;-)

Also worked on runtest's docstring, to say something about all the
arguments, and to document the non-obvious return values.

New functions runtest_inner() and cleanup_test_droppings() in
support of the above.
2006-06-09 19:24:44 +00:00
Georg Brandl 242508160e RFE #1491485: str/unicode.endswith()/startswith() now accept a tuple as first argument. 2006-06-09 18:45:48 +00:00
Georg Brandl e7ec81f130 Test file.__exit__. 2006-06-09 18:29:52 +00:00
Tim Peters 982c30b861 Whitespace normalization. 2006-06-09 17:47:00 +00:00
Phillip J. Eby 5cf565ddd1 Import wsgiref into the stdlib, as of the external version 0.1-r2181. 2006-06-09 16:40:18 +00:00
Andrew M. Kuchling 91c64a05d2 [Bug #1472827] Make saxutils.XMLGenerator handle \r\n\t in attribute values by escaping them properly. 2.4 bugfix candidate. 2006-06-09 13:15:57 +00:00
Neal Norwitz c9778a8951 Fix grammar and reflow 2006-06-09 05:54:18 +00:00
Tim Peters 71dc0a043b Remove the temporary hack to force test_optparse to
run immediately after test_file.  At least 8 buildbot
boxes passed since the underlying problem got fixed,
and they all failed before the fix, so there's no point
to this anymore.
2006-06-09 05:12:40 +00:00
Tim Peters 0556e9b119 testUnicodeOpen(): I have no idea why, but making this
test clean up after itself appears to fix the test failures
when test_optparse follows test_file.

test_main():  Get rid of TESTFN no matter what.  That's
also enough to fix the mystery failures.  Doesn't hurt
to fix them twice :-)
2006-06-09 04:02:06 +00:00
Tim Peters dbb82f623f AutoFileTests.tearDown(): Removed mysterious undocumented
try/except.  Remove TESTFN.

Throughout:  used open() instead of file(), and wrapped
long lines.
2006-06-09 03:51:41 +00:00
Tim Peters 2b6377912e To boost morale :-), force test_optparse to run immediately
after test_file until we can figure out how to fix it.
(See python-dev; at the moment we don't even know which checkin
caused the problem.)
2006-06-09 03:09:42 +00:00
Tim Peters 520d8ddd97 Whitespace normalization.
Since test_file is implicated in mysterious test failures
when followed by test_optparse, if I had any brains I'd
look at the checkin that last changed test_file ;-)
2006-06-09 02:11:02 +00:00
Brett Cannon de3b052216 Buffer objects would return the read or write buffer for a wrapped object when
the char buffer was requested.  Now it actually returns the char buffer if
available or raises a TypeError if it isn't (as is raised for the other buffer
types if they are not present but requested).

Not a backport candidate since it does change semantics of the buffer object
(although it could be argued this is enough of a bug to bother backporting).
2006-06-08 17:00:45 +00:00
Georg Brandl 442b49e938 Convert test_file to unittest. 2006-06-08 14:50:53 +00:00
Nick Coghlan 676725db92 Add functools.update_wrapper() and functools.wraps() as described in PEP 356 2006-06-08 13:54:49 +00:00
Armin Rigo fd01d7933b (arre, arigo) SF bug #1350060
Give a consistent behavior for comparison and hashing of method objects
(both user- and built-in methods).  Now compares the 'self' recursively.
The hash was already asking for the hash of 'self'.
2006-06-08 10:56:24 +00:00
Gregory P. Smith 996710fd44 pasted set_lk_detect line in wrong spot in previous commit. fixed. passes tests this time. 2006-06-08 05:39:54 +00:00
Gregory P. Smith dda291c079 * Turn the deadlock situation described in SF bug #775414 into a
DBDeadLockError exception.
* add the test case for my previous dbtables commit.
2006-06-08 05:38:11 +00:00
Gregory P. Smith ff7d991a07 - bsddb: the bsddb.dbtables Modify method now raises the proper error and
aborts the db transaction safely when a modifier callback fails.
  Fixes SF python patch/bug #1408584.

Also cleans up the bsddb.dbtables docstrings since thats the only
documentation that exists for that unadvertised module.  (people
really should really just use sqlite3)
2006-06-08 05:17:08 +00:00
Ronald Oussoren 4b7a6c8b58 * If BuildApplet.py is used as an applet it starts with a version of
sys.exutable that isn't usuable on an #!-line. That results in generated
  applets that don't actually work. Work around this problem by resetting
  sys.executable.
* argvemulator.py didn't work on intel macs. This patch fixes this
  (bug #1491468)
2006-06-07 20:18:44 +00:00
Tim Peters 80dc76e907 SF patch 1501987: Remove randomness from test_exceptions,
from ?iga Seilnacht (sorry about the name, but Firefox
on my box can't display the first character of the name --
the SF "Unix name" is zseil).

This appears to cure the oddball intermittent leaks across
runs when running test_exceptions under -R.  I'm not sure
why, but I'm too sleepy to care ;-)

The thrust of the SF patch was to remove randomness in the
pickle protocol used.  I changed the patch to use
range(pickle.HIGHEST_PROTOCOL + 1), to try both pickle and
cPickle, and randomly mucked with other test lines to put
statements on their own lines.

Not a bugfix candidate (this is fiddling new-in-2.5 code).
2006-06-07 06:57:51 +00:00
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