Fred Drake [Mon, 15 Dec 1997 21:37:45 +0000 (21:37 +0000)]
Added definitions of \refbimodindex{} and \refstmodindex{}, which should be
used to add index references for built-in and standard modules, respectively.
Modified \bimodindex{} and \stmodindex{} to make the page number bold, to
allow the defining instance of a module to stand out in the index.
Check-ins which fix improper use of \bimodindex{} and \stmodindex{} will be
made as fixes are applied. Misc. indexing updates will occur as a side
effect in some cases.
Guido van Rossum [Thu, 11 Dec 1997 02:03:55 +0000 (02:03 +0000)]
Fix problem detected by Greg McFarlane -- callbacks passed to
bind_class() and bind_all() are destroyed when the widget to which
they were passed is destroyed.
Guido van Rossum [Wed, 10 Dec 1997 23:40:18 +0000 (23:40 +0000)]
Jim Fulton writes:
The attached patch adds the following behavior to the handling
of REDUCE codes:
- A user-defined type may have a __reduce__ method that returns
a string rather than a tuple, in which case the object is
saved as a global object with a name given by the string returned
by reduce.
This was a feature added to cPickle a long time ago.
- User-defined types can now support unpickling without
executing a constructor.
The second value returned from '__reduce__' can now be None,
rather than an argument tuple. On unpickling, if the
second value returned from '__reduce__' during pickling was
None, then rather than calling the first value returned from
'__reduce__', directly, the '__basicnew__' method of the
first value returned from '__reduce__' is called without
arguments.
I also got rid of a few of Chris' extra ()s, which he used
to make python ifs look like C ifs.
Guido van Rossum [Wed, 10 Dec 1997 22:59:55 +0000 (22:59 +0000)]
At Barry's suggestion, plug the security leak by using an empty
__builtins__ for all calls to eval(). This still allows someone to
write string.atof("[1]*1000000") (which Jim Fulton worries about) but
effectively disables access to system modules and functions.
Guido van Rossum [Wed, 10 Dec 1997 22:35:02 +0000 (22:35 +0000)]
Since this module is used as a fallback in case no built-in modules
have been configured, string.atof() should not fail when "import re"
fails (usually because pcre is not there).
This opens up a tiny security hole: *if* an attacker can make "import
re" fail, they can also make string.atof(arbitrary_string) evaluate
the arbitrary string. Nothing to keep me awake at night...
Guido van Rossum [Wed, 10 Dec 1997 19:36:41 +0000 (19:36 +0000)]
Don't specify base 0 to string.atoi when unpickling integers in text
mode. The pickler always uses base 10 so the default base should be
fine. (The base gets us in trouble when there's no strop module, as
the atoi() in string.py only supports base 10. This is for JPython.)
Guido van Rossum [Wed, 10 Dec 1997 15:14:24 +0000 (15:14 +0000)]
Modified quicksort by Raymund Galvin, after studying the GNU libg++
quicksort. This should be much faster if there are lots of
duplicates, and otherwise at least as good.
Guido van Rossum [Wed, 10 Dec 1997 05:50:18 +0000 (05:50 +0000)]
Adding a new project: pythonw, or WinMain.c, containing a main program
that doesn't have a console window attached. stdout/stderr are lost.
This is handy though for things like grail.
Add explicit check for correct next character in format at end of
format. This will complain about illegal formats like "O#" instead of
ignoring the '#'.
Fred Drake [Tue, 9 Dec 1997 15:18:33 +0000 (15:18 +0000)]
libainstall: Install Modules/Setup.thread in addition to Modules/Setup and
Modules/Setup.local.
Guido: I hope this is ok; it seems to make a lot of sense to get the
whole trio of module config files installed as a set rather than
doing it partially.
Fix subtle bug in cleanup code in PyErr_NormalizeException(), detected
by Marc Lemburg. There's a path through the code where *val is NULL,
but value isn't, and value should be DECREF'ed.
Fred Drake [Mon, 8 Dec 1997 21:25:41 +0000 (21:25 +0000)]
Separated the definitions of ntohs(), ntohl(), htons(), htonl(). Separate
descriptions really make things look a bit better, and should improve the
ability to re-purpose the content.
Fred Drake [Mon, 8 Dec 1997 20:58:13 +0000 (20:58 +0000)]
Added Emacs turd so this file has the correct mode in Emacs / X/Emacs.
clean_key(): Override the standard LaTeX2HTML clean_key() to remove a
leading HTML tag, if present. This broke the indexes for the library
reference (at least) since many of the strings began with <code> or
something similar.
- Loading non-binary string pickles checks for insecure
strings. This is needed because cPickle (still)
uses a restricted eval to parse non-binary string pickles.
This change is needed to prevent untrusted
pickles like::
- User-defined types can now support unpickling without
executing a constructor.
The second value returned from __reduce__ can now be None,
rather than an argument tuple. On unpickling, if the second
value returned from __reduce__ during pickling was None, then
rather than calling the first value returned from __reduce__,
directly, the __basicnew__ method of the first value returned
from __reduce__ is called without arguments.