Commit Graph

1300 Commits

Author SHA1 Message Date
Guido van Rossum 3366d1c7e6 # Typo in docstring (Retrun -> Return). 1999-02-23 18:34:43 +00:00
Guido van Rossum 3791b0de36 Carefully check for overflow when allocating the memory for fromfile
-- someone tried to pass in sys.maxint and got bitten by the bogus
calculations.
1999-02-23 18:05:22 +00:00
Guido van Rossum c222ec28a5 Patch by Tadayoshi Funaba (with some changes) to be smarter about
guessing what happened when strftime() returns 0.  Is it buffer
overflow or was the result simply 0 bytes long?  (This happens for an
empty format string, or when the format string is a single %Z and the
timezone is unknown.)  if the buffer is at least 256 times as long as
the format, assume the latter.
1999-02-23 00:00:10 +00:00
Guido van Rossum b71c570f01 Document *static* -- in two places! 1999-02-22 18:11:18 +00:00
Guido van Rossum 360eb9f278 We don't support leap seconds, so the seconds field of a time 9-tuple
should be in the range [0-59].  Noted by Tadayoshi Funaba.
1999-02-22 16:19:52 +00:00
Guido van Rossum 5bd69db9f0 In atoi(), don't use isxdigit() to test whether the last character
converted was a "digit" -- use isalnum().  This test is there only to
guard against "+" or "-" being interpreted as a valid int literal.
Reported by Takahiro Nakayama.
1999-02-22 16:18:44 +00:00
Guido van Rossum 61eeb044d7 The docstring for ttyname(..) claims a second "mode" argument. The
actual code does not allow such an argument.  (Finn Bock.)
1999-02-22 15:29:15 +00:00
Fred Drake 1a566ff2e8 When the parameter to PyInt_AsLong() has already been checked with
PyInt_Check(), use PyInt_AS_LONG() instead (two places).
1999-02-17 17:35:53 +00:00
Fred Drake 6724835959 Use the portable form of initializing the ob_type field for new types. 1999-02-16 22:15:42 +00:00
Guido van Rossum 7d385294a4 The symbols P_* (for spawn*(), MS specific) should not have a leading
underscore after all, for consistency with the O_* symnbols.
1999-02-16 19:38:04 +00:00
Guido van Rossum b8c3cbdd50 Fixed totally bogus conversion factors used in the Win32 version of
os.times().
1999-02-16 14:37:28 +00:00
Barry Warsaw ca74da4e2c Got rid of the file-global PosixError. This was redundant since it
was just an alias for PyExc_OSError and the way we were doing it was
causing a (small) memory leak anyway.  Just use PyExc_OSError
everywhere.
1999-02-09 19:31:45 +00:00
Guido van Rossum 01b7ced834 On Windows, -i shouldn't call set[v]buf(stdin, ...) because it screws
up the _tkinter main loop.  Not clear why; the _kbhit() call _tkinter
makes probably confuses the stdio library when buffering isn't set to
whatever it is by default.
1999-02-09 18:36:51 +00:00
Guido van Rossum d1f66dc198 Fix buglet in load_put -- the test for bad readline result tested the
wrong variable.
1999-02-08 22:38:25 +00:00
Guido van Rossum 7d83a5e6f8 The variable TESTPATH should be initialized to empty.
The test code is now accessed as a package.
1999-02-08 21:49:22 +00:00
Guido van Rossum 68de0641ce The writelines() function was never tested and contained numerous bugs
(including a docstring saying "blah").  Fixed all this.

(Please review for potential memory leaks!)
1999-02-08 17:03:27 +00:00
Guido van Rossum f9ffb03c35 Jim Fulton: this fixes seg faults with bad pickles like "c". 1999-02-04 14:54:04 +00:00
Guido van Rossum 0c9608cf1b Portability fix for [f]statvfs() return tuple: no longer return the
f_fsid field, since it's not a scalar on all systems supporting this
call (in particular, it's a tuple of two longs on AIX).  Since it's
not particularly useful, just nuke it.  Adapted the doc strings too.
1999-02-03 16:32:37 +00:00
Guido van Rossum 579ed77a51 Never mind, this belongs in the PC subdirectory,
and besides Toby Dickenson sent me a more functional
(if lower level) wrapper around PlaySound.
1999-02-02 23:41:44 +00:00
Fred Drake 7e3535cbbd Added documentation to the docstrings for the W*() functions that take
a process exit status as a parameter.
1999-02-02 16:37:11 +00:00
Guido van Rossum 2cc340d122 Windows sound playing module, by Fredrik Lundh. 1999-02-02 15:14:37 +00:00
Guido van Rossum 246bc17a8b Add _P_WAIT etc. for NT. 1999-02-01 23:54:31 +00:00
Fred Drake a6dff3e772 spawnv, spawnve docstrings: added mode parameter; this is required! 1999-02-01 22:24:40 +00:00
Barry Warsaw 6aa42579be PyPcre_expand(): Fixed two memory leaks, where a PyString_FromString()
was appended to a list.  Lists are reference count neutral, so the
string must be DECREF'd.  Also added some checks for the return value
of PyList_Append().

Note: there are still some memory problems reported by Purify (I get
two Array Bounds Reads still and an Unitialized Memory Read).  Also,
in scanning the code, there appears to be some potential problems
where return values aren't checked.  To much to attack now though.
1999-02-01 17:09:00 +00:00
Guido van Rossum e6a3aa6066 Oops, the patch for NeXT always replaced waitpid() with wait4() --
this doesn't exist everywhere, so go back to using #ifdef NeXT.
1999-02-01 16:15:30 +00:00
Barry Warsaw f761287e0a setup_readline(): Added a comment about memory leak (reported by
Purify) being caused by a bug in the readline library.  Nothing we can
do about it.

Cause: readline_initialize_everything() throws away the return value
from rl_read_init_file(), but that happens to be the last reference to
a dynamically allocated char*.
1999-01-29 21:55:03 +00:00
Andrew M. Kuchling 1c7aaa2d73 Added missing DECREF's in the error branches when creating a compressor or
decompressor object.  This required adding a flag to the struct which is
    true if initialisation was completed; on object destruction, deflateEnd()
    is only called if the flag is true.
1999-01-29 21:49:34 +00:00
Barry Warsaw 30aa1e7d31 PyInit_zlib(): Plug a small memory leak. Jeremy is looking into the
more severe ones.
1999-01-28 19:40:05 +00:00
Guido van Rossum 6b86a42c7f Document -OO; "unsafe" optimization that removes docstrings.
Marc-Andre Lemburg.
1999-01-28 15:07:47 +00:00
Barry Warsaw b80667d5f3 pcre_exec(): Andrew Kuchling's patch for pcre memory leak. 1999-01-27 21:41:08 +00:00
Barry Warsaw 105906ff6e initerrno(): Nailed a not-so-tiny memory leak. The de dictionary is
put into the module dict, but is never DECREF'd in this function, so
it and all its contents leak.
1999-01-27 18:04:05 +00:00
Guido van Rossum 54ecc3d24f Patches by William Lewis for Nextstep descendants. 1999-01-27 17:53:11 +00:00
Barry Warsaw 5b97716caf expandtabs__doc__: blank line which was not terminated with \n\ caused
the SunPro C compiler to choke.  Removed this redundant line.
1999-01-26 02:15:50 +00:00
Guido van Rossum a106568eed Add spawnv and spawnve functions for Win32 platforms. 1999-01-25 23:20:23 +00:00
Guido van Rossum 54ec2884b8 A gift from Fredrik Lundh: fast C implementation of expandtabs().
I've reformatted it, added a few comments, a test for tabsize <= 0,
and used the AS_STRING macro.
1999-01-25 22:36:24 +00:00
Guido van Rossum aa8d16761b Make sure not to call realloc() with a NULL pointer -- call malloc()
in that case.  Tamito Kajiyama.
1999-01-25 21:43:51 +00:00
Guido van Rossum 11801859e0 Include myselect.h -- needed on some platforms. 1999-01-25 21:39:03 +00:00
Guido van Rossum 8bf6dc77d1 Rearrange the -I flags for compiling _tkinter.c so that
/usr/local/include comes before /usr/X11R1/include.  On some Linux
distributions the latter apparently contains (standard!) a bad tcl.h
or tk.h.
1999-01-25 21:38:29 +00:00
Guido van Rossum d371ff17a1 Only do ttyname() when HAVE_TTYNAME is defined.
Also define F_OK etc. when not already defined, when doing access().
1999-01-25 16:12:23 +00:00
Guido van Rossum ca6954a979 Should include "Python.h", not <Python.h> -- it's not a standard
header file (yet :-).
1999-01-14 19:31:42 +00:00
Guido van Rossum 11a5071ed6 Jim Ahlstrom patch: Watcom chokes on a long expression in c_asinh().
Break it up.
1999-01-14 19:11:11 +00:00
Guido van Rossum 5d00b6d459 Need extern decl. for fdatasync() in case it exists but isn't declared
anywhere (or, more likely, the declaration requires a magical
combination of _POSIX defines).
1999-01-08 21:28:05 +00:00
Guido van Rossum 21142a09f3 Added fsync() and fdatasync(). Patches by Scott Cotton. Requires
HAVE_* macros set by configure script.
1999-01-08 21:05:37 +00:00
Guido van Rossum 446ccfe1ac The doc string for strptime had the arguments reversed -- the string
comes first, the format second!  Scott Cotton discovered this.
1999-01-07 18:29:26 +00:00
Jeremy Hylton 6892aa372d fix bug in PyZlib_flush.
patch from Grzegorz Makarewicz & Rafal Smotrzyk.
1999-01-06 22:56:24 +00:00
Guido van Rossum 015f22a0fa Change the access() code to return 1 if granted, 0 if not granted.
Patch (again) by Sean Reifschneider.
1999-01-06 22:52:38 +00:00
Guido van Rossum 763737be52 Changes for long file support by Steve Clift. 1999-01-06 18:44:57 +00:00
Guido van Rossum 056bad993c Changes for long file support by Steve Clift.
He also fixes thread-related evil that caused core dumps.
1999-01-06 18:44:23 +00:00
Guido van Rossum 94f6f72c05 Changes for long file support by Steve Clift.
Also added access() and ttyname() by Sean Reifschneider.
1999-01-06 18:42:14 +00:00
Guido van Rossum 716a89c606 Patch by Charles Waldman to implement an optional nlines argument to
w.scroll().  (It then calls wscrl(win, nlines) instead of scoll(win).)
1999-01-05 17:16:46 +00:00