Add get_objects function. This is a low level function (like
get_referents, and is not yet documented in the library manual).
Suggestions for a better name welcome.
Martin v. Löwis [Thu, 9 Aug 2001 12:24:38 +0000 (12:24 +0000)]
Patch #437683: Use re instead of regex.
If multiple header files are processed simultaneously which include each
other, the corresponding modules mport each other. Specifically, if h2py
is invoked with sys/types.h first, later header files won't contain the
complete contents of TYPES.py.
Thomas Wouters [Thu, 9 Aug 2001 09:53:00 +0000 (09:53 +0000)]
Michael Hudson correctly pointed out we should cvsignore pyconfig.h, not
config.h (anymore). People will still have to delete config.h from their
source trees manually :)
Proper support for binary operators, including true division and floor
division. The basic binary operators now all correctly call the
__rxxx__ variant when they should.
In type_new(), I now make the new type a new-style number unless it
inherits from an old-style number that has numeric methods.
By way of cosmetics, I've changed the signatures of the SLOT<i> macros
to take actual function names and operator names as strings, rather
than rely on C preprocessor symbol manipulations. This makes the
calls slightly more verbose, but greatly helps simple searches through
the file: you can now find out where "__radd__" is used or where the
function slot_nb_power() is defined and where it is used.
Jack Jansen [Wed, 8 Aug 2001 22:00:26 +0000 (22:00 +0000)]
Resource files for OSX Python.framework. Incomplete, and they should probably
eventually be generated so version numbers and such are automatically
correct, but they do the job for now.
Tim Peters [Wed, 8 Aug 2001 20:50:07 +0000 (20:50 +0000)]
Thanks to
LettError, Erik van Blokland, http://www.letterror.com/
the Python Windows installer finally has an attractive Pythonic bitmap
to delight the senses and dampen the fears of the millions and millions of
eager new Windows users anticipating their first Python programming joy.
Always knew Mac users secretly wanted to switch to Windows <wink>.
Tim Peters [Wed, 8 Aug 2001 19:32:25 +0000 (19:32 +0000)]
Add the new Tools/compiler/README to the WIndows install, as README.txt.
In the Wise installer's "Advanced Options" dialog, substitute in the
actual name of "the system directory" -- this is clearer, and especially
for people reading this dialog who aren't me <wink>.
Fred Drake [Wed, 8 Aug 2001 19:14:53 +0000 (19:14 +0000)]
Added documentation for PyNumber_*FloorDivide(), PyNumber_*TrueDivide(),
PyInterpreterState_*Head(), PyInterpreterState_Next(), and
PyThreadState_Next().
Jack Jansen [Wed, 8 Aug 2001 13:56:14 +0000 (13:56 +0000)]
Various fixes to streamline build process on Mac OS X:
- Give a warning if you're on a case-insensitive filesystem and have
not specified --with-suffix.
- Don't require --with-dyld, it is now default for OSX/Darwin (suggested
by Martin v. Loewis)
- Don't define _POSIX_THREADS on Darwin, it's done by standard headers already
(fix by Tony Lownds)
- Don't use the Mac subtree anymore, the routines relevant to OSX/Darwin
have moved to a new file Python/mactoolboxglue.c.
Jack Jansen [Wed, 8 Aug 2001 13:46:49 +0000 (13:46 +0000)]
- Don't return mac-style pathnames in unix-Python.
- Fixed up a lot more prototypes (gcc also wants them on static routines)
- Fixed various other gcc warnings.
Jack Jansen [Wed, 8 Aug 2001 13:17:31 +0000 (13:17 +0000)]
Split macglue.c into two: a new mactoolboxglue.c (in ./Python)
with functionality needed for both unix-Python and MacPython and a
new smaller ./Mac/Python/macglue.c which contains MacPython stuff only.
pymactoolbox.h has moved to ./Include from ./Mac/Include and now also
contains the relevant stuff from macglue.h.
The net effect of this is that the ./Mac subdirectory is not needed
anymore for building the unix-Python core on MacOSX (it is needed
for building the extension modules).
Steve Purcell [Wed, 8 Aug 2001 07:57:26 +0000 (07:57 +0000)]
Merged in bugfix from PyUnit CVS for problem reported by Gary Todd.
If 'unittest.py' was run from the command line with the name of a test
case class as a parameter, it failed with an ugly error. (Which was a
shame, because the documentation says you can do that.)
The problem was the old 'is the class X that you imported from me the same
as my class X?' gotcha.
Tim Peters [Wed, 8 Aug 2001 06:24:48 +0000 (06:24 +0000)]
Repair the Windows build (S_ISDIR() macro doesn't exist).
Somebody else should feel free to repair this a different way; see Python-
Dev for discussion.
- A new operator // that means floor division (the kind of division
where 1/2 is 0).
- The "future division" statement ("from __future__ import division)
which changes the meaning of the / operator to implement "true
division" (where 1/2 is 0.5).
- New overloadable operators __truediv__ and __floordiv__.
- New slots in the PyNumberMethods struct for true and floor division,
new abstract APIs for them, new opcodes, and so on.
I emphasize that without the future division statement, the semantics
of / will remain unchanged until Python 3.0.
Not yet implemented are warnings (default off) when / is used with int
or long arguments.
This has been on display since 7/31 as SF patch #443474.
Jack Jansen [Wed, 8 Aug 2001 00:36:53 +0000 (00:36 +0000)]
Commented out most of the MacPython modules. There is a discussion on the
pythonmac-sig about turning this all into a package, so in the mean time
there is no reason to scribble all over people's disks. Interested parties
can uncomment them.
Tim Peters [Tue, 7 Aug 2001 22:10:00 +0000 (22:10 +0000)]
Part of SF patch [#431848] mathmodule.c: doc strings & conversion, from
Peter Schneider-Kamp.
Clarified some docstrings in the spirit of the patch; left out the
degrees() and radians() functions (see the patch comments on SF).
Jeremy Hylton [Tue, 7 Aug 2001 21:12:25 +0000 (21:12 +0000)]
Fix SF bug [ #447370 ] typo in urllib2.py
Also fix another bug caught by pychecker-- HTTPError() raised when
redirect limit exceed did not pass an fp object. Had to change method
to keep fp object around until it's certain that the error won't be
raised.
Apply two small changes to the Windows code, according to SF bug
#427345. These are supposed to support binary data and avoid
buffering problems on Windows.
Fred Drake [Tue, 7 Aug 2001 19:49:15 +0000 (19:49 +0000)]
Remove make_re() function; this is no longer needed since _sre and pcre
are now allowed by ok_builtin_modules. This effectively backs out
revision 1.26.
Fred Drake [Tue, 7 Aug 2001 19:14:46 +0000 (19:14 +0000)]
Make sure XMLGenerator uses quoteattr() instead of escape() to quote
attribute values. Just using escape() can (and always has) led to broken
XML being generated. This makes sure it always produces the right thing.
Remove the __iter__ method from the UserDict class -- it can silently
break old code (in extreme cases). See SF bug #448153.
Add a new subclass IterableUserDict that has the __iter__ method.
Note that for new projects, unless backwards compatibility with
pre-2.2 Python is required, subclassing 'dictionary' is recommended;
UserDict might become deprecated.
- Add an explicit call to PyType_Ready(&PyList_Type) to pythonrun.c
(just for the heck of it, really -- we should either explicitly
ready all types, or none).
Add the NannyNag exception class and the process_tokens() function to
__all__, to indicate these are implied as part of the public API.
IDLE's "Check Module" command uses this, and it broke once already
because the reset_globals() and tokeneater() functions were deleted
when Neil converted this to using the generator API of tokenizer.
(See SF bug #448835.)
- Add comment blocks explaining add_operators() and override_slots().
(This file could use some more explaining, but this is all I had
breath for today. :)
- Renamed the argument 'base' of add_wrappers() to 'wraps' because
it's not a base class (which is what the 'base' identifier is used
for elsewhere).
Small nits:
- Fix add_tp_new_wrapper() to avoid overwriting an existing __new__
descriptor in tp_defined.
- In add_operators(), check the return value of add_tp_new_wrapper().
Functional change:
- Remove the tp_new functionality from PyBaseObject_Type; this means
you can no longer instantiate the 'object' type. It's only useful
as a base class.
- To make up for the above loss, add tp_new to dynamic types. This
has to be done in a hackish way (after override_slots() has been
called, with an explicit call to add_tp_new_wrapper() at the very
end) because otherwise I ran into recursive calls of slot_tp_new().
Sigh.
Jack Jansen [Tue, 7 Aug 2001 13:53:25 +0000 (13:53 +0000)]
Bit another bullet: all toolbox modules are now in dynamically loaded modules. Everything still seems to work, but the ConfigurePythonXXX on initial install may still need work.
Tim Peters [Mon, 6 Aug 2001 20:01:19 +0000 (20:01 +0000)]
+ Turn off patch creation (this isn't a patch release! got turned on by
mistake).
+ Arrange for Win2K Add/Remove to show a Python icon.
I think this "does it" -- a full install/uninstall can now be done on a
Win2K box from an ordinary (not Admin, not Power User) user acct, incl.
file extension registration, Start Menu entries, and full Add/Remove.
Jack Jansen [Sun, 5 Aug 2001 22:31:19 +0000 (22:31 +0000)]
Replace moddir and incdir by
moddirlist and incdirlist, lists of source and include
directories that are searched for modules.
This is needed because the Mac modules and include files
live in the Mac subtree.
In addition (and that's actually what the mod is all about) on OSX we build all the Mac extension modules.
Tim Peters [Sun, 5 Aug 2001 13:58:48 +0000 (13:58 +0000)]
+ Made installer more reluctant to overwrite MS C runtime DLLs -- it's
been overwriting them even if they have the same version, not just if
they're an older version (and our installers have always done this).
+ Added an "Advanced Options" subdialog to "Select Components". Allows
to do a non-admin install even if you have Administrator rights, and
to skip registering file extensions and/or creating Start Menu
shortcuts. Since so far these installers have been tested only by me,
and Win2K has been full of surprises, I want those options available
out in the field.
Lots of web searching turned up what should have been obvious: Because
Windows Installer is a native Win2K service, it can run at a higher
privilege level than the user invoking it. So MSI installs don't bash
into these permission gotchas on Win2K, but Wise 8.1 does (it's just
another app to Win2K, and we're not alone in wrestling with this; but,
like changing int division in Python, Win2K is doing a right thing <wink>).
Tim Peters [Sun, 5 Aug 2001 05:19:15 +0000 (05:19 +0000)]
+ Redid file associations on Win2K in what I believe is "the right way".
Can't test it until getting to a Win2K box, because the non-Admin way
of setting file associations on Win2K doesn't work on any other flavor
of Windows (and other flavors of Windows never need Admin privs to
do it the old way).
+ Consequently got rid of the "Register file associations" Component and
associated GUI.
+ Added a line to the summary saying whether or not this is an Admin-level
install (I fear that will be an important clue someday).
+ Minor fiddling to the summary to reduce the # of lines. Added a
horizontal scrollbar in case the install path is very long.
+ Reworked the way the Main and Tools components share pydoc.pyw; cleaner
and simpler.
Tim Peters [Sun, 5 Aug 2001 04:12:30 +0000 (04:12 +0000)]
New runtime vrbl DOADMIN. When false, we never try to write under HKLM,
and install the Python and MS runtime DLLs into the Python dir instead of
a system dir.
Initial value is taken from new compiler vrbl _DOADMIN_ (default true),
and forced to false if the user doesn't have admin privs.
This makes it possible to *test* non-admin installs on machines where the
distinction doesn't exist (like my home box), via just changing _DOADMIN_.
It may also be useful for users who don't *want* an installer to
scribble into their system dir (for example, me(! most days)), but that
would require adding more GUI to let them get at it.
Tim Peters [Sat, 4 Aug 2001 23:23:27 +0000 (23:23 +0000)]
+ Add version info to Win2K add/remove.
+ Fiddle vrbls so Win2K add/remove can display version w/o future manual
script fiddling.
+ Break apart the mysterious wizard-generated Win2K "Edit 3 Registry Keys"
script items by hand into 3 separate items, so you can see what the heck
they're doing in the script view.
+ pydoc.pyw was a problem: it's installed by both the Main and Tools
components. So when both were selected, the second time it got
installed Wise figured it was overwriting a pre-existing version, and
made a backup copy in BACKUP. A rollback-uninstall then restored that,
leaving the Tools/Scripts/ directory non-empty, and so Wise couldn't
remove that directory (or any above it). Fixed by installing pydoc.pyw
at most once.
+ Rearranged and commented the "register file extensions" section, because
it was confusing and needs more work: turns out it's not true that
Win2K requires Admin privs to register file extensions, BUT, if you
don't have Admin privs, Win2K requires a new way to register file
extensions, and a way that doesn't blow up but doesn't do any good either
on earlier Windows flavors. I think I know how to get this done, but am
too depressed to do it right now <0.7 wink>.