Commit Graph

13110 Commits

Author SHA1 Message Date
Guido van Rossum e8d2d6b34c Some new names (some contributors of patches that haven't even been
accepted yet!)
2000-06-29 00:04:51 +00:00
Guido van Rossum 5e08cb8e50 Vladimir Marangozov:
This patch fixes a problem on AIX with the signed int case code in
getargs.c, after Trent Mick's intervention about MIN/MAX overflow
checks. The AIX compiler/optimizer generates bogus code with the
default flags "-g -O" causing test_builtin to fail: int("10", 16) <>
16L. Swapping the two checks in the signed int code makes the problem
go away.

Also, make the error messages fit in 80 char lines in the
source.
2000-06-28 23:53:56 +00:00
Guido van Rossum d7823f2645 Vladimir Marangozov:
Avoid calling the dealloc function, previously triggered with
DECREF(inst).  This caused a segfault in PyDict_GetItem, called with a
NULL dict, whenever inst->in_dict fails under low-memory conditions.
2000-06-28 23:46:07 +00:00
Guido van Rossum 98626cd7ac Urmpf. Quality control on this patch lapsed a bit. :-(
The depth field was never decremented inside w_object(), and it was
never initialized in PyMarshal_WriteObjectToFile().

This caused imports from .pyc files to fil mysteriously when the .pyc
file was written by the broken code -- w_object() would bail out
early, but PyMarshal_WriteObjectToFile() doesn't check the error or
return an error code, and apparently the marshalling code doesn't call
PyErr_Check() either.  (That's a separate patch if I feel like it.)
2000-06-28 23:24:19 +00:00
Guido van Rossum a04ff0fb53 Running the program through itself reveals that one end tag was
mislabeled.

(Using -c and then -e rearranges some comments, so I won't check that
in -- but it's a good test anyway.

Note that pindent is not perfect -- e.g. it doesn't know about
triple-quoted strings!)
2000-06-28 22:55:20 +00:00
Guido van Rossum 59811b189d Peter Schneider-Kamp:
Problem:
A Python program can be completed and reformatted using
Tools/scripts/pindent.py. Unfortunately there is no option for removal
of the generated "# end"-tags.  Although a few Python commands or a
"grep -v '# end '" can do wonders here, there are two drawbacks:
- not everyone has grep/time to write a Python script
- it is not checked whether the "# end"-tags were used validly

Solution:
add extra option "-e" (eliminate) to pindent.py
2000-06-28 22:47:22 +00:00
Guido van Rossum cc6a438d7f Trent Mick:
Fix warnings on 64-bit build build of signalmodule.c

- Though I know that SIG_DFL and SIG_IGN are just small constants,
there are cast to function pointers so the appropriate Python call is
PyLong_FromVoidPtr so that the pointer value cannot overflow on Win64
where sizeof(long) < sizeof(void*).
2000-06-28 22:26:21 +00:00
Guido van Rossum 534b7c5c96 Trent Mick:
This patch fixes cPickle.c for 64-bit platforms.

- The false assumption sizeof(long) == size(void*) exists where
PyInt_FromLong is used to represent a pointer. The safe Python call
for this is PyLong_FromVoidPtr. (On platforms where the above
assumption *is* true a PyInt is returned as before so there is no
effective change.)

- use size_t instead of int for some variables
2000-06-28 22:23:56 +00:00
Guido van Rossum 1c44e28766 Trent Mick: familiar simple Win64 patches 2000-06-28 22:20:06 +00:00
Fred Drake ab43fcad5f Give Moshe some work to do. 2000-06-28 22:13:06 +00:00
Fred Drake 5c529d3f3e Add a "See also:" link to the curses.ascii module. 2000-06-28 22:11:40 +00:00
Fred Drake 589f44b9d0 Made the title of the Examples subsection plural! 2000-06-28 22:09:20 +00:00
Fred Drake be93a8332e Added note that the atexit module was added for Python 1.6. 2000-06-28 22:07:55 +00:00
Guido van Rossum 582acece2e Trent Mick's Win64 changes: size_t vs. int or long; also some overflow
tests.
2000-06-28 22:07:35 +00:00
Fred Drake 6f2a5efec9 Added entry for the curses.ascii module. 2000-06-28 22:05:44 +00:00
Fred Drake 5ccd4b2a54 Added entries for the curses.ascii module. 2000-06-28 22:03:29 +00:00
Guido van Rossum 6da3434e03 Trent Mick: familiar simple Win64 patches 2000-06-28 22:00:02 +00:00
Jack Jansen 0ed1148b75 added ucnhash (optional on USE_UCNHASH) and the mysteriously disappeared math. 2000-06-28 21:59:35 +00:00
Jack Jansen e641ba1e6a ucnhash and various other modules added. 2000-06-28 21:58:03 +00:00
Jack Jansen 2819146cc7 Added USE_UCNHASH (experimental, I hope it can go), USE_TOOLBOX and USE_QT. 2000-06-28 21:57:24 +00:00
Guido van Rossum ad89bbcd88 Trent Mick: change a few casts for Win64 compatibility. 2000-06-28 21:57:18 +00:00
Jack Jansen 2c9cb7aff3 Added USE_UCNHASH (experimental, I hope it can go) 2000-06-28 21:57:05 +00:00
Fred Drake 4e716fa0ac Skip Montanaro <skip@mojam.com>:
Added an example of using an HTTP POST request.
2000-06-28 21:51:43 +00:00
Guido van Rossum fa48116993 Trent Mick: use size_t instead of int where appropriate (time_strftime()). 2000-06-28 21:33:59 +00:00
Guido van Rossum e826895d48 Trent Mick: use size_t instead of int where appropriate (set_key()). 2000-06-28 21:31:10 +00:00
Guido van Rossum 26418a90f0 Trent Mick: use size_t instead of int where appropriate (call_readline()). 2000-06-28 21:30:31 +00:00
Guido van Rossum 2650a42f0b Trent Mick: use size_t instead of int where appropriate (mpz_format()). 2000-06-28 21:29:47 +00:00
Guido van Rossum b6f657c0cc Trent Mick: use size_t instead of int where appropriate (various spots). 2000-06-28 21:29:03 +00:00
Guido van Rossum 7d0ae5e14e Trent Mick: use size_t instead of int where appropriate (in
fromfile(), to hold fread() result.)
2000-06-28 21:27:21 +00:00
Guido van Rossum 2f8a054418 Trent Mick: use size_t instead of int where appropriate (in strxfrm(),
to hold strlen() outcome).
2000-06-28 21:23:33 +00:00
Guido van Rossum 3262e16753 Trent Mick:
This patches fixes a possible overflow of the optional timeout
parameter for the select() function (selectmodule.c). This timeout is
passed in as a double and then truncated to an int. If the double is
sufficiently large you can get unexpected results as it
overflows. This patch raises an overflow if the given select timeout
overflows.

[GvR: To my embarrassment, the original code was assuming an int could
always hold a million.  Note that the overflow check doesn't test for
a very large *negative* timeout passed in -- but who in the world
would do such a thing?]
2000-06-28 21:18:13 +00:00
Guido van Rossum 106f2dae86 Trent Mick:
Various small fixes to the builtin module to ensure no buffer
overflows.

- chunk #1:
Proper casting to ensure no truncation, and hence no surprises, in the
comparison.

- chunk #2:
The id() function guarantees a unique return value for different
objects.  It does this by returning the pointer to the object. By
returning a PyInt, on Win64 (sizeof(long) < sizeof(void*)) the pointer
is truncated and the guarantee may be proven false. The appropriate
return function is PyLong_FromVoidPtr, this returns a PyLong if that
is necessary to return the pointer without truncation.

[GvR: note that this means that id() can now return a long on Win32
platforms.  This *might* break some code...]

- chunk #3:
Ensure no overflow in raw_input(). Granted the user would have to pass
in >2GB of data but it *is* a possible buffer overflow condition.
2000-06-28 21:12:25 +00:00
Fred Drake 7388f730a3 Support constant as a font name for the first column of a table using the
tableii & friends markup family.
2000-06-28 21:06:08 +00:00
Guido van Rossum eceebb87d9 Jack Jansen: Moved includes to the top, removed think C support 2000-06-28 20:57:07 +00:00
Guido van Rossum 40ced50cb0 Jack Jansen: Mac Carbon: don't include sys/types if we don't have it 2000-06-28 20:56:30 +00:00
Guido van Rossum 9cb1cabb77 Jack Jansen: Removed support for long-dead Think C compiler 2000-06-28 20:55:34 +00:00
Guido van Rossum 6b7a5d8959 Jack Jansen: Removed Macintosh tab-guessing code 2000-06-28 20:54:53 +00:00
Guido van Rossum b7c298f806 Jack Jansen: Support for conditional inclusion of methods and functions 2000-06-28 20:53:33 +00:00
Fred Drake 35c09f2e51 Revise the description of when functions retrieved from class instances
are and are not turned into bound methods; some confusion was noted by
Andrew Dalke.

In particular, it has to be noted that functions located on the class
instance are not turned into any sort of method, only those which are
found via the underlying class.
2000-06-28 20:15:47 +00:00
Fred Drake 6da0b9148c Michael Hudson <mwh21@cam.ac.uk>:
As I really do not have anything better to do at the moment, I have written
a patch to Python/marshal.c that prevents Python dumping core when trying
to marshal stack bustingly deep (or recursive) data structure.

It just throws an exception; even slightly clever handling of recursive
data is what pickle is for...

[Fred Drake:]  Moved magic constant 5000 to a #define.

This closes SourceForge patch #100645.
2000-06-28 18:47:56 +00:00
Fred Drake 7833447f8f Trent Mick <trentm@activestate.com>:
Testing: test_array.py was also extended to check that one can set the
full range of values for each of the integral signed and unsigned
array types.

This closes SourceForge patch #100506.
2000-06-28 17:50:51 +00:00
Fred Drake 541dc3b7b2 Trent Mick <trentm@activestate.com>:
The cause: Relatively recent (last month) patches to getargs.c added
overflow checking to the PyArg_Parse*() integral formatters thereby
restricting 'b' to unsigned char value and 'h','i', and 'l' to signed
integral values (i.e. if the incoming value is outside of the
specified bounds you get an OverflowError, previous it silently
overflowed).

The problem: This broke the array module (as Fredrik pointed out)
because *its* formatters relied on the loose allowance of signed and
unsigned ranges being able to pass through PyArg_Parse*()'s
formatters.

The fix: This patch fixes the array module to work with the more
strict bounds checking now in PyArg_Parse*().

How: If the type signature of a formatter in the arraymodule exactly
matches one in PyArg_Parse*(), then use that directly. If there is no
equivalent type signature in PyArg_Parse*() (e.g. there is no unsigned
int formatter in PyArg_Parse*()), then use the next one up and do some
extra bounds checking in the array module.

This partially closes SourceForge patch #100506.
2000-06-28 17:49:30 +00:00
Fred Drake c82634c13c Thomas Wouters <thomas@xs4all.net>:
Documentation updates related to the addition of openpty() and forkpty().
2000-06-28 17:27:48 +00:00
Marc-André Lemburg 4e5302a27e Marc-Andre Lemburg <mal@lemburg.com>:
Perfect hash table generator. Outputs a Python extension module
which provides access to the hash table (which is stored in static
C data) using custom code.

This module can currently only generates code for the ucnhash
module, but can easily be adapted to produce perfect hash tables
for other tasks where fast lookup in large tables is needed.

By Bill Tutt.
2000-06-28 16:53:16 +00:00
Marc-André Lemburg c5bb9c21fe Marc-Andre Lemburg <mal@lemburg.com>:
Generator for the new ucnhash module (ucnhash.h|c). Uses perfect_hash.py
to create the ucnhash module.
2000-06-28 16:49:29 +00:00
Marc-André Lemburg 93c409a590 Marc-Andre Lemburg <mal@lemburg.com>:
Utility extension module needed by perfect_hash.py

By Bill Tutt.
2000-06-28 16:48:05 +00:00
Marc-André Lemburg 0f774e3987 Marc-Andre Lemburg <mal@lemburg.com>:
Patch to the standard unicode-escape codec which dynamically
loads the Unicode name to ordinal mapping from the module
ucnhash.

By Bill Tutt.
2000-06-28 16:43:35 +00:00
Marc-André Lemburg 2dabf69f5c Marc-Andre Lemburg <mal@lemburg.com>:
Added new ucnhash module by Bill Tutt.
2000-06-28 16:42:39 +00:00
Marc-André Lemburg b0c0ecfa26 Marc-Andre Lemburg <mal@lemburg.com>:
Added new ucnhash module.
2000-06-28 16:42:14 +00:00
Marc-André Lemburg 4a9188c557 Marc-Andre Lemburg <mal@lemburg.com>:
Updated test output.
2000-06-28 16:41:46 +00:00