Thomas Wouters [Fri, 21 Apr 2006 11:26:56 +0000 (11:26 +0000)]
Fix variable/format-char discrepancy in new-style class __getitem__,
__delitem__, __setslice__ and __delslice__ hooks. This caused test_weakref
and test_userlist to fail in the p3yk branch (where UserList, like all
classes, is new-style) on amd64 systems, with open-ended slices: the
sys.maxint value for empty-endpoint was transformed into -1.
This is a long-ago patch I submitted to SF (1100924) to time the gc passes.
Barry approved it awhile ago. Been sitting in my sandbox for awhile as
well.
Jack Jansen [Thu, 20 Apr 2006 21:38:17 +0000 (21:38 +0000)]
- tp_init shouldn't call base class tp_init by default
- tp_new (which was apparently always overridden:-) called base class
tp_init in stead of tp_new.
Thomas Wouters [Wed, 19 Apr 2006 14:50:15 +0000 (14:50 +0000)]
Use Py_ssize_t to hold the 'width' argument to the ljust, rjust, center and
zfill stringmethods, so they can create strings larger than 2Gb on 64bit
systems (even win64.) The unicode versions of these methods already did this
right.
Added a pycremoval rule. Called by clean, it removes all .pyc and .pyo files.
Handy to have as a separate rule from clean when mucking around with bytecode
generation.
C++ compiler cleanup: the typical few casts, and ... C++ didn't like that
the StgDictObject's ffi_type member had the same name as its type. I
changed that to ffi_type_pointer. Feel free to change it to something else
more meaningful, just not ffi_type.
Split ``get_platform()`` into ``get_supported_platform()`` and
``get_build_platform()`` to work around a Mac versioning problem that caused
the behavior of ``compatible_platforms()`` to be platform specific.
Tim Peters [Tue, 18 Apr 2006 03:28:32 +0000 (03:28 +0000)]
Finally figured out why this module did its imports at the
bottom of the file. Restored that, and added a comment
explaining why this is necessary. Hint: on my box, and
yours, it's not :-(
test_pyclbr goes nuts when a module contains code to try importing a class
and provide a substitute if the import fails, because pyclbr sees the
class definition. Changed to ignore such cases' base classes and methods,
since they will not match.
pydoc now supports PEP 302 importers, by way of utility functions in
pkgutil, such as 'walk_packages()'. It will properly document
modules that are in zip files, and is backward compatible to Python
2.3 (setuptools installs for Python <2.5 will bundle it so pydoc
doesn't break when used with eggs.)
What has not changed is that pydoc command line options do not support
zip paths or other importer paths, and the webserver index does not
support sys.meta_path. Those are probably okay as limitations.
Tasks remaining: write docs and Misc/NEWS for pkgutil/pydoc changes,
and update setuptools to use pkgutil wherever possible, then add it
to the stdlib.
C++ compilation cleanup: Migrate declaration of
_PyObject_Call(Function|Method)_SizeT into Include/abstract.h. This gets
them under the umbrella of the extern "C" { ... } block in that file.
Tim Peters [Mon, 17 Apr 2006 21:12:33 +0000 (21:12 +0000)]
local.__del__(): This didn't actually do anything, because of too
much convolution <0.5 wink>. Simplified to the point that it works,
and test_threading_local no longer reports leaks under -R. Thanks
to Thomas Wouters for initial analysis.
This revision strips all the PEP 302 emulation code from runpy,
replacing it with published API classes and functions in pkgutil,
mostly using setuptools' implementation of common functionality,
but adding features from runpy, and doing some refactoring to make
the layer pydoc needs easier to implement on top of this.
One step down, four to go, although step #4 (adding C versions of
the new APIs to 'imp') may not be able to make it in time for
alpha 2. We'll see how that goes.
Ronald Oussoren [Mon, 17 Apr 2006 14:43:30 +0000 (14:43 +0000)]
disutils checks if MACOSX_DEPLOYMENT_TARGET is consistent with the value at
configure time. The current check is too strict and doesn't allow building
extensions that can only run on newer versions of the OS than the version
python was build for, that is python build for 10.3 or later and an extension
for 10.4. This patch relaxes this check.
This turned out to be a reimplementation of patch 1193190.
now failed with pyconfig.h not found. Prior to r45232
the above command did not look for pyconfig.h, but the
bug is really in the look-up code: expecting to find it
in os.curdir is a rather fragile idea.