Fred Drake [Wed, 17 Dec 1997 03:08:27 +0000 (03:08 +0000)]
gen_index_id(): New function. Construct an index key such that the sort
is stable and the form is only defined in one place, since we do
some fancy footwork with the keys to separate the defining instance
of a module reference from other references in the HTML index.
make_index_entry(): Override the standard definition to use get_index_id().
make_str_index_entry(): Moved to myformat.perl; only needed there.
index_key_eq(): Override the standard definition. Add key transforms to
remove extra junk from the end of the keys; it was only there to
maintain ordering.
clean_key(): Remove key transform no longer needed at this stage, because
keeping it makes the sort unstable.
add_idx(): Add key transforms to undo the mess we do to separate a module's
defining and reference entries. Don't make the text bold.
Guido van Rossum [Tue, 16 Dec 1997 21:12:47 +0000 (21:12 +0000)]
Fix a bug in translate(): the pointer was incremented by the length of
the *escaped* url. Also added new special characters that are not
part of the url when found at the end: ( < > .
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.