Walter Dörwald [Fri, 14 Apr 2006 18:25:39 +0000 (18:25 +0000)]
Add a BufferedIncrementalEncoder class that can be used for implementing
an incremental encoder that must retain part of the data between calls
to the encode() method.
Fix the incremental encoder and decoder for the IDNA encoding.
Restore test tee with some modifications.
The test case came from test_generators, not test_itertools.
Ensure there's no cyclic garbage we are counting.
This is weird because it leaks, then reaches a limit:
SF Bug #1454485, array.array('u') could crash the interpreter when
passing a string. Martin already fixed the actual crash by ensuring
Py_UNICODE is unsigned. As discussed on python-dev, this fix
removes the possibility of creating a unicode string from a raw buffer.
There is an outstanding question of how to fix the crash in 2.4.
Tim Peters [Thu, 13 Apr 2006 23:12:24 +0000 (23:12 +0000)]
When using -R, lots of "*** DocTestRunner.merge:" nuisance messages
appear. Get rid of them by nuking doctest's default DocTestRunner
instance as part of cleanup(). Also cleanup() before running the
first test repetition (the test was run once before we get into
the -R branch).
test_compile can be really long if we are using -u compiler.
This may be causing the debian sparc buildbot to fail.
Print a little message to let the user ^w buildbot know it's still thinking.
We may want to adjust the time period which is currently 5 minutes.
Anthony Baxter [Thu, 13 Apr 2006 02:06:09 +0000 (02:06 +0000)]
spread the extern "C" { } magic pixie dust around. Python itself builds now
using a C++ compiler. Still lots and lots of errors in the modules built by
setup.py, and a bunch of warnings from g++ in the core.
Anthony Baxter [Thu, 13 Apr 2006 01:34:33 +0000 (01:34 +0000)]
reverting r45321: Patch #860326: traceback.format_exception_only() now
prepends the exception's module name to non-builtin exceptions, like
the interpreter itself does.
broke a number of doctests. should be discussed before checking in (see
discussion on python-dev).
bsddb.*open() methods cachesize parameter wouldn't work (raised an
internal bsddb.db exception when it was given). The set_cachesize
call needed to be moved from the DB object to the DBEnv since the env
was introduced to allow for threading.
Using None for a filename with the 'n' flag when calling bsddb.btopen
would cause an error while checking if the file None existed. error
not likely to be seen as anyone using None for a filename would likely
use the 'c' flag in the first place.
Tim Peters [Wed, 12 Apr 2006 06:44:36 +0000 (06:44 +0000)]
gen_throw(): The caller doesn't own PyArg_ParseTuple()
"O" arguments, so must not decref them. This accounts
for why running test_contextlib.test_main() in a loop
eventually tried to deallocate Py_None.
Update comments and the skip list, maybe some of these tests don't
report failures, we'll see.
Skip certain hopeless tests: compiler and logging.
compiler will likely always show varying leaks since it doesn't work
on a defined set of modules unless -u compiler is specified. But that
takes forever (we only run with -u network currently).
Anthony Baxter [Wed, 12 Apr 2006 00:43:09 +0000 (00:43 +0000)]
per Jeremy's email, remove the _WITH_CAST versions of macros. g++
still has errors from the casts of asdl_seq_GET to cmpop_ty, but
otherwise it's C++ clean.
Thomas Wouters [Wed, 12 Apr 2006 00:06:34 +0000 (00:06 +0000)]
Fix SF bug #1466641: multiple adjacent 'if's in listcomps and genexps, as in
[x for x in it if x if x], were broken for no good reason by the PEP 308
patch.
Thomas Wouters [Tue, 11 Apr 2006 23:50:33 +0000 (23:50 +0000)]
Fix int() and long() to repr() their argument when formatting the exception,
to avoid confusing situations like:
>>> int("")
ValueError: invalid literal for int():
>>> int("2\n\n2")
ValueError: invalid literal for int(): 2
2
Also report the base used, to avoid:
ValueError: invalid literal for int(): 2
They now report:
>>> int("")
ValueError: invalid literal for int() with base 10: ''
>>> int("2\n\n2")
ValueError: invalid literal for int() with base 10: '2\n\n2'
>>> int("2", 2)
ValueError: invalid literal for int() with base 2: '2'
(Reporting the base could be avoided when base is 10, which is the default,
but hrm.) Another effect of these changes is that the errormessage can be
longer; before, it was cut off at about 250 characters. Now, it can be up to
four times as long, as the unrepr'ed string is cut off at 200 characters,
instead.
No tests were added or changed, since testing for exact errormsgs is (pardon
the pun) somewhat errorprone, and I consider not testing the exact text
preferable. The actually changed code is tested frequent enough in the
test_builtin test as it is (120 runs for each of ints and longs.)