Thomas Wouters [Tue, 28 Mar 2006 08:44:55 +0000 (08:44 +0000)]
In true regression-test spirit, make sure the
itertools.tee->instance->attribute->itertools.tee and
itertools.tee->teedataobject->itertools.tee cycles, which can be found now
that itertools.tee and its teedataobject participate in GC, remain findable
and cleanable. The test won't fail when they aren't, but at least the
frequent hunt-refleaks runs would spot the rise in refleaks.
Thomas Wouters [Mon, 27 Mar 2006 21:02:13 +0000 (21:02 +0000)]
Make itertools.tee and its internal teedataobject participate in GC. This
alone does not solve the leak in test_generators, unfortunately, but it is
part of test_generators' problem and it does solve other cycles.
def foo((x)): was getting recognized as requiring tuple unpacking
which is not correct.
Add tests for this case and the proper way to unpack a tuple of one:
def foo((x,)):
test_inpsect was incorrect before. I'm not sure why it was passing,
but that has been corrected with a test for both functions above.
This means the test (and therefore inspect.getargspec()) are broken in 2.4.
Tim Peters [Sun, 26 Mar 2006 23:27:58 +0000 (23:27 +0000)]
Years in the making.
objimpl.h, pymem.h: Stop mapping PyMem_{Del, DEL} and PyMem_{Free, FREE}
to PyObject_{Free, FREE} in a release build. They're aliases for the
system free() now.
_subprocess.c/sp_handle_dealloc(): Since the memory was originally
obtained via PyObject_NEW, it must be released via PyObject_FREE (or
_DEL).
pythonrun.c, tokenizer.c, parsermodule.c: I lost count of the number of
PyObject vs PyMem mismatches in these -- it's like the specific
function called at each site was picked at random, sometimes even with
memory obtained via PyMem getting released via PyObject. Changed most
to use PyObject uniformly, since the blobs allocated are predictably
small in most cases, and obmalloc is generally faster than system
mallocs then.
If extension modules in real life prove as sloppy as Python's front
end, we'll have to revert the objimpl.h + pymem.h part of this patch.
Note that no problems will show up in a debug build (all calls still go
thru obmalloc then). Problems will show up only in a release build, most
likely segfaults.
Neal Norwitz [Sun, 26 Mar 2006 03:11:57 +0000 (03:11 +0000)]
Try to handle sys.getfilesystemencoding() returning None.
ascii seems like the safest bet that it will exist. I wonder if utf-8
would be a better choice? This should get test_fileinput passing on OpenBSD.
Phillip J. Eby [Sat, 25 Mar 2006 00:28:24 +0000 (00:28 +0000)]
Fix a problem with @contextmanager not detecting a broken generator
that yields after a throw(). Make @contextmanager not reraise
exceptions, but return a false value in that case instead. Add test
cases for both behaviors.
Hye-Shik Chang [Thu, 23 Mar 2006 12:32:36 +0000 (12:32 +0000)]
Patch #1396919: Reenable the system scope threads on FreeBSD 5.4
and later versions because they bumped the default setting to
get our basic tests to run correctly..
Hye-Shik Chang [Thu, 23 Mar 2006 12:04:37 +0000 (12:04 +0000)]
Skip to install files for empty directories; to name it, Lib/lib-old.
BSD make stops the build when it tries to expand wild cards on empty
directories.
Thomas Heller [Wed, 22 Mar 2006 12:59:53 +0000 (12:59 +0000)]
Include <malloc.h> on windows, to avoid warnings when compiling with mingw.
Don't use SEH when compiling wth mingw.
Use IS_INTRESOURCE to determine function name from function ordinal.
Rewrite the code that allocates and frees callback functions, hopefully
this avoids the coverty warnings: Remove the THUNK typedef, and move the
definition of struct ffi_info into the header file.