Commit Graph

1581 Commits

Author SHA1 Message Date
Fred Drake 947121fd9c Add a comment about needing to change a #include if using a version of
Berkeley DB 2.0 or newer; most Linux distros will include a more recent
version than 1.85.
2000-06-30 04:17:11 +00:00
Fred Drake a04eaad5c7 Trent Mick <trentm@activestate.com>:
This patch fixes possible overflows in the socket module for 64-bit
platforms (mainly Win64). The changes are:

- abstract the socket type to SOCKET_T (this is SOCKET on Windows, int
on Un*x), this is necessary because sizeof(SOCKET) > sizeof(int) on
Win64

- use INVALID_SOCKET on Win32/64 for an error return value for
accept()

- ensure no overflow of the socket variable for: (1) a PyObject return
value (use PyLong_FromLongLong if necessary); and (2) printf
formatting in repr().

Closes SourceForge patch #100516.
2000-06-30 02:46:07 +00:00
Guido van Rossum f385c5e544 Patch by Nadav Horesh to make acosh and asinh better.
Tim posted a long comment to python-dev (subject: "Controversial patch
(cmath)"; date: 6/29/00).  The conclusion is that this whole module
stinks and this patch isn't perfect, but it's better than the acosh
and asinh we had, so let's check it in.
2000-06-30 02:29:22 +00:00
Fredrik Lundh 01016fe972 - fixed split behaviour on empty matches
- fixed compiler problems when using locale/unicode flags

- fixed group/octal code parsing in sub/subn templates
2000-06-30 00:27:46 +00:00
Fredrik Lundh 29c08beab0 still trying to figure out how to fix the remaining
group reset problem.  in the meantime, I added some
optimizations:

- added "inline" directive to LOCAL

  (this assumes that AC_C_INLINE does what it's
  supposed to do).  to compile SRE on a non-unix
  platform that doesn't support inline, you have
  to add a "#define inline" somewhere...

- added code to generate a SRE_OP_INFO primitive

- added code to do fast prefix search

  (enabled by the USE_FAST_SEARCH define; default
  is on, in this release)
2000-06-29 23:33:12 +00:00
Fred Drake 0e12395190 Trent Mick <trentm@activestate.com>:
This patch fixes a possible overflow in the Sleep system call on
Win32/64 in the time_sleep() function in the time module. For very
large values of the give time to sleep the number of milliseconds can
overflow and give unexpected sleep intervals. THis patch raises an
OverflowError if the value overflows.

Closes SourceForge patch #100514.
2000-06-29 21:31:02 +00:00
Fred Drake 699f352fb2 Trent Mick <trentm@activestate.com>:
This patch fixes the posix module for large file support mainly on
Win64, although some general cleanup is done as well.

The changes are:

- abstract stat->STAT, fstat->FSTAT, and struct stat->STRUCT_STAT
This is because stat() etc. are not the correct functions to use on
Win64 (nor maybe on other platforms?, if not then it is now trivial to
select the appropriate one). On Win64 the appropriate system functions
are _stati64(), etc.

- add _pystat_fromstructstat(), it builds the return tuple for the
fstat system call. This functionality was being duplicated. As well
the construction of the tuple was modified to ensure no overflow of
the time_t elements (sizeof(time_t) > sizeof(long) on Win64).

- add overflow protection for the return values of posix_spawnv and
posix_spawnve

- use the proper 64-bit capable lseek() on Win64

- use intptr_t instead of long where appropriate from Win32/64 blocks
(sizeof(void*) > sizeof(long) on Win64)

This closes SourceForge patch #100513.
2000-06-29 21:12:41 +00:00
Fred Drake dfb4ebda24 Trent Mick <trentm@activestate.com>:
Mark Hammond provided (a long time ago) a better Win32 specific
time_clock implementation in timemodule.c. The library for this
implementation does not exist on Win64 (yet, at least). This patch
makes Win64 fall back on the system's clock() function for
time_clock().

This closes SourceForge patch #100512.
2000-06-29 20:56:28 +00:00
Fredrik Lundh 8094611eb8 - fixed another split problem
(those semantics are weird...)

- got rid of $Id$'s (for the moment, at least).  in other
  words, there should be no more "empty" checkins.

- internal: some minor cleanups.
2000-06-29 18:03:25 +00:00
Fredrik Lundh be2211e940 - fixed split
(test_sre still complains about split, but that's caused by
  the group reset bug, not split itself)

- added more mark slots
  (should be dynamically allocated, but 100 is better than 32.
  and checking for the upper limit is better than overwriting
  the memory ;-)

- internal: renamed the cursor helper class

- internal: removed some bloat from sre_compile
2000-06-29 16:57:40 +00:00
Barry Warsaw 3937c8a738 Updated the comment in this file to reflect the new defaults. Threads
are enabled by default now unless --without-threads is given to
configure.
2000-06-29 16:08:28 +00:00
Jeremy Hylton a22a0b3e86 pyexpat notes: add the name of the archive to the ar command 2000-06-29 14:40:45 +00:00
Fredrik Lundh b389df3402 - renamed "tolower" hook (it happened to work with
my compiler, but not on guido's box...)
2000-06-29 12:48:37 +00:00
Fredrik Lundh 75f2d675ed - last patch broke parse_template; fixed by changing some
tests in sre_patch back to previous version

- fixed return value from findall

- renamed a bunch of functions inside _sre (way too
  many leading underscores...)

</F>
2000-06-29 11:34:28 +00:00
Fredrik Lundh 6c68dc7b1a - removed "alpha only" licensing restriction
- removed some hacks that worked around 1.6 alpha bugs
- removed bogus test code from sre_parse
2000-06-29 10:34:56 +00:00
Fredrik Lundh 436c3d58a2 towards 1.6b1 2000-06-29 08:58:44 +00:00
Fredrik Lundh 102f3ad676 towards 1.6b1 2000-06-29 08:55:54 +00:00
Fred Drake 3de16f3db4 Improve explanation of how to build the pyexpat module. 2000-06-29 05:29:08 +00:00
Guido van Rossum 4f4b799b33 Jack Jansen: Use include "" instead of <>; and staticforward declarations 2000-06-29 00:06:39 +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 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 40ced50cb0 Jack Jansen: Mac Carbon: don't include sys/types if we don't have it 2000-06-28 20:56:30 +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
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
Fred Drake 8cef4cf737 Thomas Wouters <thomas@xs4all.net>:
This patch adds the openpty() and forkpty() library calls to posixmodule.c,
when they are available on the target
system. (glibc-2.1-based Linux systems, FreeBSD and BSDI at least, probably
the other BSD-based systems as well.)

Lib/pty.py is also rewritten to use openpty when available, but falls
back to the old SGI method or the "manual" BSD open-a-pty
code. Openpty() is necessary to use the Unix98 ptys under Linux 2.2,
or when using non-standard tty names under (at least) BSDI, which is
why I needed it, myself ;-) forkpty() is included for symmetry.
2000-06-28 16:40:38 +00:00
Marc-André Lemburg 8fb8748a5f Marc-Andre Lemburg <mal@lemburg.com>:
New ucnhash module by Bill Tutt. This module contains the hash
table needed to map Unicode character names to Unicode ordinals
and is loaded on-the-fly by the standard unicode-escape codec.
2000-06-28 16:38:56 +00:00
Andrew M. Kuchling a1e4b05ac4 Fixes for compiling on Tru64.
Define a STRICT_SYSV_CURSES macro on SGI, Sun, and Tru64, to mark systems
that don't support some features.
2000-06-27 21:49:47 +00:00
Andrew M. Kuchling b6e468796a Fix two typos (, instead of ;) 2000-06-27 15:01:10 +00:00
Andrew M. Kuchling 8e9d23b250 Added support for mouse functions: mousemask(), mouseinterval(),
getmouse(), ungetmouse(), and window.enclose().  wmouse_trafo() seems
of marginal importance at the moment.
2000-06-27 03:10:38 +00:00
Andrew M. Kuchling beba056cd7 Added support for passing Unicode strings to Expat handlers by default.
This version still includes #ifdef hackery to compile with 1.5.2.
2000-06-27 00:33:30 +00:00
Andrew M. Kuchling f419572708 Release the global interpreter lock around the most important
functions that might block or pause
2000-06-23 01:36:21 +00:00
Andrew M. Kuchling 97311bbb0e Added .timeout() method and .typeahead() function 2000-06-21 01:41:48 +00:00
Fred Drake aef1000bff Fixed docstring typo, reported by Skip Montanaro <skip@mojam.com>. 2000-06-19 13:17:41 +00:00
Andrew M. Kuchling 288e97b7fe Patch from Michael Hudson to fix flatten recursive data structures:
[mwh21@atrus build]$ ./python
>>> import Tkinter
>>> l = []
>>> l.append(l)
>>> Tkinter._flatten(l)
Segmentation fault (core dumped)
2000-06-19 00:55:09 +00:00
Andrew M. Kuchling ea34a84e54 Patch from Lorenzo M. Catucci:
I discovered the [MREMAP_MAYMOVE] symbol is only defined when _GNU_SOURCE is
defined; therefore, here is the change: if we are compiling for linux,
define _GNU_SOURCE before including mman.h, and all is done.
2000-06-18 19:06:49 +00:00
Andrew M. Kuchling e475e70128 Patch from /F:
this patch adds a fast _flatten function to the _tkinter
module, and imports it from Tkinter.py (if available).

this speeds up canvas operations like create_line and
create_polygon.  for example, a create_line with 5000
vertices runs about 50 times faster with this patch in
place.
2000-06-18 18:45:50 +00:00
Andrew M. Kuchling 6fef30e1fa Support resizing the mapping depending on whether HAVE_MREMAP is defined
Remove two unused variables
2000-06-18 14:51:21 +00:00
Andrew M. Kuchling 70d2742fce Patch from Trent Mick:
The seek() method is broken for any 'whence' value (seek from
	start, current, orend) other than the default. I have a patch
	that fixes that as well as gets mmap'd files working on
	Linux64 and Win64.
2000-06-18 04:45:14 +00:00
Andrew M. Kuchling 9bc5f3339a Removed MS_INVALIDATE flags 2000-06-18 04:25:08 +00:00
Andrew M. Kuchling 7b9fb92932 Fix the size() method to return the size of the file on Unix, not the
size of the mapped area.  This seems to be what the Windows version does.
This change requires keeping around the fd of the mapped file.
2000-06-17 22:41:22 +00:00
Andrew M. Kuchling b7f198e01a Renamed the C extension for ncurses support from 'curses' to '_curses'.
(The SourceForge admins have been asked to rename the ,v file.)
2000-06-10 23:12:32 +00:00
Marc-André Lemburg 753131c90a Marc-Andre Lemburg <mal@lemburg.com>:
The locale module is turned on per default.
2000-06-07 09:12:54 +00:00
Andrew M. Kuchling 54c8dc2144 Patch from Trent Mick:
Fix a small bug in posixmodule.c where a char* is being
	dereferenced where it should not be.
2000-06-06 20:52:17 +00:00
Andrew M. Kuchling 841b9fbebb Use PyArg_ParseTuple and specify the method names, following a suggestion
from Greg Stein
2000-06-03 20:43:43 +00:00
Andrew M. Kuchling 961fe17b4c Add missing PyArg_NoArgs() calls to methods that didn't take arguments
(Pointed out by Moshe Zadka)
2000-06-03 19:41:42 +00:00
Jeremy Hylton b1aa19515f Fredrik Lundh: here's the 96.6% version of SRE 2000-06-01 17:39:12 +00:00
Andrew M. Kuchling 94c3452ade Fix bug reported by atkins@gweep.net; re.compile(r"[\100-\410]")
dumps core.  Solution: fix check_escape() to match its comment and
   use only the low 8 bits of the octal number.
2000-06-01 03:02:48 +00:00
Fred Drake 137507ea03 Michael Hudson <mwh21@cam.ac.uk>:
Removed PyErr_BadArgument() calls and replaced them with more useful
error messages.
2000-06-01 02:02:46 +00:00
Jeremy Hylton 847a9968e9 Patch from M.-A. Lemburg:
Python on UNIX now trusts PYTHONHOME unconditionally

Modules/getpath.c:

Landmark changed to os.py.

Setting PYTHONHOME now unconditionally sets sys.prefix
(and sys.exec_prefix). No further checks are done whether the
standard lib can be found in that location or not. This is in
sync with the PC subdir getpath implementations.

PC/getpathp.c:

Landmark changed to os.py.

PC/os2vacpp/getpathp.c:

Landmark changed to os.py.

Note: BAW's checkin on exceptions.c eliminates earlier concerns about
a bogus PYTHONHOME value leading to a core dump.  Instead it causes a
useless sys.path and prevents imports.
2000-05-26 21:49:07 +00:00
Barry Warsaw c8019add6c _exceptions.c is moved to ../Python/exceptions.c 2000-05-26 19:03:19 +00:00
Barry Warsaw b1387aa7af The _exceptions module is moved to the Python subdirectory. 2000-05-26 19:02:42 +00:00
Barry Warsaw 8415edb433 Built-in class-based standard exceptions. Written by Fredrik Lundh.
Modified, proofread, and integrated for Python 1.6 by Barry Warsaw.
2000-05-25 23:18:47 +00:00
Barry Warsaw cfa2dba720 Added the _exceptions module, implementing the built-in class-based
standard exceptions.
2000-05-25 23:10:52 +00:00
Andrew M. Kuchling 03e644b851 Changes by AMK: Use HAVE_NCURSES_H to include correct header file
Lots of typo fixes (a bit too much cut-and-paste in this module)
Aliases removed: attr_on, attr_off, attr_set
Lowercased the names COLOR_PAIR and PAIR_NUMBER
#ifdef's for compiling on Solaris added (need to understand SYSV curses
    versions better and generalize this)
Bumped version number bumped to 1.6
2000-05-23 16:24:54 +00:00
Andrew M. Kuchling 22b88ce6bf Oliver Andrich's ncurses-specific curses module, version 1.5b1 2000-05-23 16:18:03 +00:00
Fred Drake 11b093641a Donn Cave <donn@oz.net>:
BeOS (up to 5.0) lacks <netinet/tcp.h>.
2000-05-16 13:30:12 +00:00
Guido van Rossum c9a5f343bc The addition of rint() (by Peter Schneider-Kamp; I forgot to mention
that before) in the previous patch has one problem; rint() is not in
the C math library on all platforms (e.g. not for VC++).  Make it
conditional on HAVE_RINT.
2000-05-11 18:42:27 +00:00
Guido van Rossum 71260b846e Added math.rint() -- round according to current IEEE754 mode 2000-05-11 18:19:42 +00:00
Fred Drake aff601804d M.-A. Lemburg <mal@lemburg.com>:
Fixed a bug due to a /* inside /*...*/. GCC doesn't like
this and bombs.
2000-05-09 19:52:40 +00:00
Guido van Rossum ea2b7157ab New version from Jim Fulton to fix a problem that Eric Raymond ran
into.  Jim writes:

The core dump was due to a C decrement operation
in a macro invocation in load_pop.  (BAD)

I fixed this by moving the decrement outside
the macro call.

I added a comment to load_pop and load_mark
to document the fact that cPickle separates the
unpickling stack into two separate stacks, one for
objects and one for marks.

I also moved some increments out of some macro
calls (PyTuple_SET_ITEM and PyList_SET_ITEM).
This wasn't necessary, but made me feel better. :)

I tested these changes in *my* cPickle, which
doesn't have the new Unicode stuff.
2000-05-09 18:14:50 +00:00
Guido van Rossum c554505ca1 Trent Mick:
Fix overflow bug in ldexp(x, exp). The 'exp' argument maps to a C int for the
math library call [double ldexp(double, int)], however the 'd'
PyArg_ParseTuple formatter was used to yield a double, which was subsequently
cast to an int. This could overflow.

[GvR: mysteriously, on Solaris 2.7, ldexp(1, 2147483647) returns Inf
while ldexp(1, 2147483646) raises OverflowError; this seems a bug in
the math library (it also takes a real long time to compute the
Inf outcome).  Does this point to a bug in the CHECK() macro?  It
should have discovered that the result was outside the HUGE_VAL range.]
2000-05-08 14:29:38 +00:00
Guido van Rossum 69529ad0cc When the UTF-8 conversion to Unicode fails, return an 8-bit string
instead.  This seems more robust than returning an Unicode string with
some unconverted charcters in it.

This still doesn't support getting truly binary data out of Tcl, since
we look for the trailing null byte; but the old (pre-Unicode) code did
this too, so apparently there's no need.  (Plus, I really don't feel
like finding out how Tcl deals with this in each version.)
2000-05-04 15:55:17 +00:00
Guido van Rossum 990f5c6c98 Two changes to improve (I hope) Unicode support.
1. In Tcl 8.2 and later, use Tcl_NewUnicodeObj() when passing a Python
Unicode object rather than going through UTF-8.  (This function
doesn't exist in Tcl 8.1, so there the original UTF-8 code is still
used; in Tcl 8.0 there is no support for Unicode.)  This assumes that
Tcl_UniChar is the same thing as Py_UNICODE; a run-time error is
issued if this is not the case.

2. In Tcl 8.1 and later (i.e., whenever Tcl supports Unicode), when a
string returned from Tcl contains bytes with the top bit set, we
assume it is encoded in UTF-8, and decode it into a Unicode string
object.

Notes:

- Passing Unicode strings to Tcl 8.0 does not do the right thing; this
isn't worth fixing.

- When passing an 8-bit string to Tcl 8.1 or later that has bytes with
the top bit set, Tcl tries to interpret it as UTF-8; it seems to fall
back on Latin-1 for non-UTF-8 bytes.  I'm not sure what to do about
this besides telling the user to disambiguate such strings by
converting them to Unicode (forcing the user to be explicit about the
encoding).

- Obviously it won't be possible to get binary data out of Tk this
way.  Do we need that ability?  How to do it?
2000-05-04 15:07:16 +00:00
Guido van Rossum b18618dab7 Vladimir Marangozov's long-awaited malloc restructuring.
For more comments, read the patches@python.org archives.
For documentation read the comments in mymalloc.h and objimpl.h.

(This is not exactly what Vladimir posted to the patches list; I've
made a few changes, and Vladimir sent me a fix in private email for a
problem that only occurs in debug mode.  I'm also holding back on his
change to main.c, which seems unnecessary to me.)
2000-05-03 23:44:39 +00:00
Guido van Rossum 2808b744e8 Remove all references to stdwin. 2000-05-03 22:34:12 +00:00
Guido van Rossum 31c9a27c12 >>Boing!<<
Finally, this long-obsolete module bites the dust.
2000-05-03 22:33:14 +00:00
Guido van Rossum 98e189dab4 Vladimir Marangozov:
Change Py_Malloc/Realloc/Free calls to PyMem_Malloc/Realloc/Free +
PyErr_Nomemory on error check.  Py_Malloc c.s. are obsolete.
2000-05-03 22:30:13 +00:00
Guido van Rossum 19dde103a8 Mark Hammond to the rescue:
Checkin 2.131 of posixmodule.c changed os.stat on Windows, so that
"/bin/" type notation (trailing backslash) would work on Windows to
be consistent with Unix.

However, the patch broke the simple case of: os.stat("\\")

This did work in 1.5.2, and obviously should!

This patch addresses this, and restores the correct behaviour.
2000-05-03 02:44:55 +00:00
Guido van Rossum 7d64b48eaf Disable the ZEROTRAP code -- this turns a 0 byte into a 2 byte and I
don't think that's what we want.  There was some brief discussion
of this somewhere but I don't recall where.
2000-05-02 21:18:13 +00:00
Barry Warsaw 57e11ae847 usage_mid: Remove the description of the -X flag; it's gone now.
Py_Main(): Remove the 'X' case.
2000-05-02 19:20:26 +00:00
Barry Warsaw ee98e4e75d Ignore a bunch of generated files. 2000-05-02 18:34:30 +00:00
Guido van Rossum c15a9a1f98 Marc-Andre Lemburg:
Added -U command line option.

With the option enabled the Python compiler interprets all "..."
strings as u"..." (same with r"..." and ur"...").
2000-05-01 17:54:33 +00:00
Barry Warsaw 3cef856dd9 posix_utime(): Allow the second argument to be None, which invokes the
utime(path, NULL) call, setting the atime and mtime of the file to the
current time.  The previous signature utime(path, (atime, mtime)) is
of course still allowed.
2000-05-01 16:17:24 +00:00
Guido van Rossum 8823accd1f Marc-Andre Lemburg:
Fixes a memory leak found by Fredrik Lundh.
2000-04-27 20:14:31 +00:00
Guido van Rossum c410e92974 Jack Jansen:
This patch is a workaround for Macintosh, where the GUSI I/O library
(time, stat, etc) use the MacOS epoch of 1-Jan-1904 and the MSL C
library (ctime, localtime, etc) uses the (apparently ANSI standard)
epoch of 1-Jan-1900. Python programs see the MacOS epoch and we
convert values when needed.
2000-04-26 20:40:13 +00:00
Guido van Rossum 50422b403c Michael Hudson:
This patch changes posixmodule.c:execv to

a) check for zero length args (does this to execve, too), raising
   ValueError.

b) raises more rational exceptions for various flavours of duff arguments.
   I *hate*
      TypeError: "illegal argument type for built-in operation"
   It has to be one of the most frustrating error messages ever.
2000-04-26 20:34:28 +00:00
Guido van Rossum 14f3f59d2b Fix typo in last patch -- the symbol's name is MSG_DONWAIT, not
MSG_DONTWAIT.  Reported by Fredrik Lundh.
2000-04-25 21:53:58 +00:00
Guido van Rossum 2c8bcb8794 Patch by Charles G Waldman:
1)  Adds MSG_DONTWAIT if defined (I needed this)
2)  Spells "coreectly" correctly ;-)
2000-04-25 21:34:53 +00:00
Guido van Rossum c4428c58bb Charles G Waldman: Doing a PyObject_New then PyMem_DEL causes havoc if
you are trying to use Py_TRACE_REFS.
2000-04-25 15:59:32 +00:00
Fred Drake e7ab64e070 validate_arglist(): Re-written to reflect extended call syntax.
validate_numnodes():  Added comment to explain the sometimes idiomatic
        usage pattern.
2000-04-25 04:14:46 +00:00
Guido van Rossum ff3ab42c04 Jack Jansen: The GUSI 2.0 I/O library used on the Mac uses the
socklen_t (unsigned int) for most size parameters.  Apparently this is
part of the UNIX 98 standard.

[GvR: the changes to configure.in etc. that I just checked in make
sure that socklen_t is defined everywhere, so I deleted the little
part of Jack's mod to define socklen_t if not in GUSI2.  I suppose I
will have to add it to the Windows config.h in a minute.]
2000-04-24 15:16:03 +00:00
Guido van Rossum 83addc7a0f Charles Waldman writes:
"""
Problem description:

	Run the following script:

import test.test_cpickle
for x in xrange(1000000):
    reload(test.test_cpickle)

Watch Python's memory use go up up and away!

In the course of debugging this I also saw that cPickle is
inconsistent with pickle - if you attempt a pickle.load or pickle.dump
on a closed file, you get a ValueError, whereas the corresponding
cPickle operations give an IOError.  Since cPickle is advertised as
being compatible with pickle, I changed these exceptions to match.
"""
2000-04-21 20:49:36 +00:00
Guido van Rossum 2dd8dddef4 Use an explicit macro SOCKETCLOSE which expands to closesocket (on
Windows), soclose (on OS2), or to close (everywhere else).

Hopefully this fixes a new compilation error that I suddenly get on
Windows because the macro definition for close -> closesocket
apparently was done before including io.h, which contains a prototype
for close.  (No idea why this wasn't an error before.)
2000-04-21 20:33:00 +00:00
Guido van Rossum ace88aebbb Patch by Brian Hooper, somewhat augmented by GvR, to strip a trailing
backslash from the pathname argument to stat() on Windows -- while on
Unix, stat("/bin/") succeeds and does the same thing as stat("/bin"),
on Windows, stat("\\windows\\") fails while stat("\\windows") succeeds.
This modified version of the patch recognizes both / and \.

(This is odd behavior of the MS C library, since
os.listdir("\\windows\\") succeeds!)
2000-04-21 18:54:45 +00:00
Fred Drake ff9ea480eb ANSI-fy & de-tabify the source.
(4-space indents already used.)
2000-04-19 13:54:15 +00:00
Barry Warsaw 3155db3b79 setup_confname_table(): Close memory leak caused by not decref'ing the
inserted dictionary values.  Also, simplified the logic a bit.
2000-04-13 15:20:40 +00:00
Jeremy Hylton 127b2ef2d5 raise TypeError when bad argument passed to cStringIO.StringIO 2000-04-12 22:04:01 +00:00
Guido van Rossum 36d4f8b0ec Correct fix by Mark Favas for the cast problems. 2000-04-10 21:34:37 +00:00
Guido van Rossum e110dcfa86 I've had complaints about the comparison "where >= 0" before -- on
IRIX, it doesn't even compile.  Added a cast: "where >= (char *)0".
2000-04-10 21:14:05 +00:00
Guido van Rossum 29530886af Remove CRLF line endings.
Fredrik Lundh: add two missing casts.
2000-04-10 17:06:55 +00:00
Guido van Rossum 5db862dd0c Skip Montanaro: add string precisions to calls to PyErr_Format
to prevent possible buffer overruns.
2000-04-10 12:46:51 +00:00