Commit Graph

1330 Commits

Author SHA1 Message Date
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
Guido van Rossum 0a6363d7e1 Get rid of the strptype() declaration -- on some BSD systems, it's a
conflict, and it should be declared in time.h anyway.
(Too bad if gcc -Wall won't be happy if it isn't declared...)
1999-01-03 13:00:34 +00:00
Guido van Rossum 11847896ed Chris Herborth discovered a typo in the arrow key symbols. 1998-12-23 04:45:04 +00:00
Guido van Rossum 65d5b5763c Thanks to Chris Herborth, the thread primitives now have proper Py*
names in the source code (they already had those for the linker,
through some smart macros; but the source still had the old, un-Py names).
1998-12-21 19:32:43 +00:00
Guido van Rossum 95864d35c6 Add dummy variable to avoid optimizer bug on OS/2 -- patch by Jeff Rush.
(AMK: you should probably copy this into your patch set for pcre.)
1998-12-21 18:35:49 +00:00
Jeremy Hylton 5bc4abe006 replace missing zalloc initialization (test_zlib now runs
successfully)
1998-12-21 17:15:00 +00:00
Jeremy Hylton 36252022ec remove debugging fprintf (should have checked this before previous
checkin)
1998-12-21 16:40:21 +00:00
Jeremy Hylton a37e244536 patches from Andrew
NOTE: There is still a bug of some sort in the behavior of zlib.  In
at least one case, inflate returns Z_OK (which is typically
interpreted to mean that more output space is needed) when it has
finished inflating a buffer.  This has been reported as a bug to the
zlib maintainers; we may need to change the Python interface.
1998-12-18 22:13:11 +00:00
Fred Drake 6de7d0c338 When _PyString_Resize() reports failure, the variable referring to the
string we wanted to resize is set to NULL.  Don't Py_DECREF() those
variables!  (5 places)
1998-12-18 19:46:59 +00:00
Guido van Rossum 476e49f055 Jim Fulton writes:
This fixes a bug that can cause core dumps when doing seeks in input
StringIO objects. This has a number of other clean-ups.
1998-12-15 21:43:15 +00:00
Andrew M. Kuchling 4c07f81d60 Fixed bug reported to Gregor Hoffleit:
> mpz.mpz('\xff') should return mpz(255).  Instead it returns
> mpz(4294967295L). Looks like the constructor doesn't work with strings
> containing characters above chr(128).
Caused by using just 'char' where 'unsigned char' should have been used.
1998-12-14 19:36:14 +00:00
Guido van Rossum 21ef088265 Need to initialize self->safe_constructors early on to prevent crash
in early dealloc.  Patch by Andrew Dalke.
1998-12-11 03:20:00 +00:00
Guido van Rossum 732aa2f987 Gregor Hoffleit writes:
But IMHO, this problem really reveals an annoyance in Python's
makesetup. makesetup puts the global include directories "$(INCLUDEPY)
$(EXECINCLUDEPY)" in front of the directories defined by the module in
Setup. Therefore global (potentially older) header files are preferred
over the ones set by the module, which makes it hard to compile new
versions of modules when the old versions are installed. AFAIK, the
other way around is common practice for most other software.

This patch to makesetup would be an potential fix for this problem,
though I don't know if it breaks anything else.
1998-12-11 01:10:29 +00:00
Guido van Rossum 46e9705eca Remove prototypes for PyOS_strto[u]l -- Chris Herborth. 1998-12-10 16:57:44 +00:00
Guido van Rossum 5de54208a5 Needed to add DL_EXPORT to (redundant?) extern decl of module init function. 1998-12-10 16:49:28 +00:00
Guido van Rossum e94e3fbb72 Make VC++ 5.0 compiler happy. 1998-12-08 17:37:19 +00:00
Guido van Rossum b057dd8efa Correctly document atan2. 1998-12-08 16:27:10 +00:00
Guido van Rossum 9c1201fe39 Py_Main() must be DL_EXPORT too. 1998-12-07 14:28:47 +00:00
Guido van Rossum c6e22902ad Added Doc strings -- by Chris Petrilli. 1998-12-04 19:26:43 +00:00
Guido van Rossum 3886bb6997 Add DL_EXPORT() to all modules that could possibly be used
on BeOS or Windows.
1998-12-04 18:50:17 +00:00
Guido van Rossum 50f385c197 Fix two small bugs; add DL_EXPORT() to initcPickle decl. 1998-12-04 18:48:44 +00:00
Guido van Rossum 3b5330ef2d Bernard Herzog pointed out that rl_parse_and_bind modifies its
argument string (bad function!), so we make a temporary copy.
1998-12-04 15:34:39 +00:00
Guido van Rossum 053b8dfcde New version from Jim Fulton:
- New copyright. (Open source)

  - Added new protocol for binary string pickles that
    takes out unneeded puts:

      p=Pickler()
      p.dump(x)
      p.dump(y)
      thePickle=p.getvalue()

    This has little or no impact on pickling time, but
    often reduces unpickling time and pickle size, sometimes
    significantly.

  - Changed unpickler to use internal data structure instead
    of list to reduce unpickling times by about a third.

  - Many cleanups to get rid of obfuscated error handling
    involving 'goto finally' and status variables.

  - Extensive reGuidofication. (formatting :)

  - Fixed binary floating-point pickling bug. 0.0 was not
    pickled correctly.

  - Now use binary floating point format when saving
    floats in binary mode.

  - Fixed some error message spelling error.
1998-11-25 16:18:00 +00:00
Guido van Rossum 7d9b4133eb New version from Jim Fulton:
- New copyright. (Open source)

  - Fixed problem in seek method.  The seek method should (and now does)
    fill with nulls when seeking past the end of the "file".
1998-11-25 16:17:32 +00:00
Guido van Rossum 185ead6f37 Doc strings by Chris Petrilli. 1998-11-23 15:32:55 +00:00
Guido van Rossum e9bc62d993 RajGopal Srinivasan noted that the latest code doesn't work when
running in a non-threaded environment.  He added some #ifdefs that fix
this.
1998-11-17 03:45:24 +00:00
Barry Warsaw b0d1b068d9 audio(7I) suggests that applications do the following to get the
device and control pseudo-device:

- first look for the device filename in the environment variable
  AUDIODEV.

- if not found, use /dev/audio

- calculate the control device by tacking "ctl" onto the base device
  name.

We now do this.  Also, if the open fails, we call
PyErr_SetFromErrnoWithFilename() to give a more informative error
message.

Added a fileno() method to the audio object returned from open().
This returns the file descriptor which can be used by applications to
set up SIGPOLL notification, as per the manpage.
1998-10-31 22:52:54 +00:00
Guido van Rossum 3f200d76df Add note about compiling FORMS with -Dclear=__GLclear.
(The GLHACK variable isn't really needed since the change to
glmodule.c, but I'm too busy to remove it.  It's harmless.)
1998-10-21 17:03:36 +00:00
Guido van Rossum 89733a8bd6 Check in the changed version after running the stubber again -- this
solves the conflict with curses over the 'clear' entry point much
nicer.  (Jack had checked in the changes to cstubs eons ago, but I
never regenrated glmodule.c :-( )
1998-10-21 16:10:40 +00:00
Guido van Rossum 605b93dee2 On a recommendation from Sjoerd Mullender, add -Dclear=__GLclear to
the compilation flags for the gl, fl and fm modules.  This avoids a
name conflict with the curses module (both gl and curses have an entry
point called 'clear').
1998-10-21 15:08:40 +00:00
Guido van Rossum bf338300ff Add a missing DECREF in an error exit. Submitted by Jonathan Giddy. 1998-10-19 13:38:36 +00:00
Guido van Rossum d3a6a14330 Doc strings by Chris Petrilli.
Also added MD5Type object.
1998-10-14 13:46:57 +00:00
Guido van Rossum a0deb64024 No need to issue a fatal error if the PyDict_SetItemString fails; the
caller (in import.c) will test for errors and take appropriate action.
1998-10-14 13:45:06 +00:00
Guido van Rossum fc6aba5008 ACK! There was still an unescaped newline in a docstring. 1998-10-14 02:52:31 +00:00
Guido van Rossum b39b90dda2 Doc strings by Chris Petrilli. 1998-10-13 14:27:22 +00:00
Guido van Rossum 41f0a98f8f Looks like I didn't test this interactively. The EventHook() code was
broken; it asked for the current thread state when there was none.
Fixed by using the saved event_tstate.
1998-10-12 16:26:22 +00:00
Guido van Rossum dc1adabcb8 Patch by Jonathan Giddy (with some cleanup by me) to always use the
thread state of the thread calling mainloop() (or another event
handling function) rather than the thread state of the function that
created the client data structure.
1998-10-09 20:51:18 +00:00
Guido van Rossum 215193bd93 There's no need to declare Tk_GetNumMainWindows() (and it breaks
something in the latest win342 build).
1998-10-08 02:27:41 +00:00
Guido van Rossum 7e48898d86 Use the t# format where appropriate. Greg Stein. 1998-10-08 02:25:24 +00:00
Guido van Rossum 2a570049ac Changes to deal with the sigcheck+intrcheck vs. signalmodule controversy. 1998-10-07 22:51:56 +00:00
Guido van Rossum d076c73cc8 Changes to support other object types besides strings
as the code string of code objects, as long as they support
the (readonly) buffer interface.  By Greg Stein.
1998-10-07 19:42:25 +00:00
Guido van Rossum c501583dfa Make gcc -Wall happy. 1998-10-07 16:36:14 +00:00
Guido van Rossum 89bae99c5d Make gcc -Wall happy:
Remove unused decls of getloclock() and is_lockobject().
1998-10-07 16:35:54 +00:00
Guido van Rossum c20687355b Make gcc -Wall happy:
(1) add dummy decl for strptime();
(2) move the code to set accept2dyear to the front of inittime().
1998-10-07 16:35:25 +00:00
Guido van Rossum e7adf3eb6d Documented PYTHONOPTIMIZE; by Marc Lemburg. 1998-10-07 14:50:06 +00:00
Guido van Rossum d5f6c223a9 Make the version variable static (it has no business being exported). 1998-10-07 14:48:53 +00:00
Guido van Rossum 7fef86ea71 Clarify sharedinstall comment 1998-10-07 14:41:54 +00:00
Guido van Rossum d5bcf9a343 Andrew Dalke's implementation of string.count(). 1998-10-06 19:43:14 +00:00
Guido van Rossum 573788eef1 No need for (char *) cast from gdbm_strerror(). 1998-10-03 05:15:07 +00:00
Guido van Rossum b6e2a99aa6 Win32 port. Patches by Milton L. Hankins. 1998-10-03 05:13:27 +00:00
Guido van Rossum 49b560698b Renamed thread.h to pythread.h. 1998-10-01 20:42:43 +00:00
Guido van Rossum 2645241add Fixes for OS/2 by Jeff Rush. 1998-09-28 22:07:11 +00:00
Guido van Rossum be70450f03 Removed some OS/2 #defines (now in the OS/2 specific config.h).
Patch by Jeff Rush.
1998-09-28 21:55:25 +00:00
Guido van Rossum 469067800b Get rid of the test for non-NULL thread state in EventHook; it can be
triggered in situations that are not an error.
1998-09-21 14:47:16 +00:00
Guido van Rossum 1b236768e7 When we have siginterrupt(), use it to disable restarting interrupted
system calls.
1998-09-21 14:46:00 +00:00
Guido van Rossum 0db4c94d09 Enable the 'new' module by default. 1998-09-21 14:45:22 +00:00
Guido van Rossum 78694d970f Patches from Greg Stein to support 'P' format in struct module's
native format, as void* (translated to Python int or long).
Also adds PyLong_FromVoidPtr and PyLong_AsVoidPtr to longobject.c.
1998-09-18 14:14:13 +00:00
Guido van Rossum ce11393136 Remove some unused variables from gethostbyaddr_ex and gethostbyaddr,
discovered by Marc Lemburg.
1998-09-13 15:52:13 +00:00
Guido van Rossum 76d1f96fe2 Michael P. Reilly suggested this fix: makesetup wants to prepend
"$(srcdir)/" before all source files even when is starts with "/".
1998-09-09 14:04:51 +00:00
Guido van Rossum 164543607c Now that we have standard (optional) long long support, the long long
support in this module can go.  The patch only deletes code
(PyLong_FromLongLong() and PyLong_AsLongLong()).  By Sjoerd Mullender.
1998-08-31 14:14:09 +00:00
Guido van Rossum cfbaecc546 Y2K fix affecting asctime(), mktime(), strftime().
2-digit years are now converted using rules that are (according to
Fredrik Lundh) recommended by POSIX or X/Open: 0-68 mean 2000-2068,
69-99 mean 1969-1999.

2-digit years are now only accepted if time.accept2dyear is set to a
nonzero integer; if it is zero or not an integer or absent, only year
values >= 1900 are accepted.  Year values 100-1899 and negative year
values are never accepted.

The initial value of time.accept2dyear depends on the environment
variable PYTHONY2K: if PYTHONY2K is set and non-empty,
time.accept2dyear is initialized to 0; if PYTHONY2K is empty or not
set, time.accept2dyear is initialized to 0.
1998-08-25 14:51:12 +00:00
Jeremy Hylton ce616e4009 Enter Jim Fulton's latest version. He writes:
I had to make a slight diddle to work with Python 1.4, which
we and some of our customers are still using. :(

I've also made a few minor enhancements:

  - You can now both get and set the memo using a 'memo'
    attribute.  This is handy for certain advanced applications
    that we have.

  - Added a 'binary' attribute to get and set the binary
    mode for a pickler.

  - Added a somewhat experimental 'fast' attribute.  When this
    is set, objects are not placed in the memo during pickling.
    This should lead to faster pickling and smaller pickles in
    cases where:

      o you *know* there are no circular references, and

      o either you've:

        - preloaded the memo with class information
          by pickling classes in non-fast mode or by
          manipilating the memo directly, or

        - aren't pickling instances.
1998-08-13 23:13:52 +00:00
Guido van Rossum 541f241132 Need mytime.h for Sleep(). 1998-08-13 13:29:22 +00:00
Jeremy Hylton d10552379d Two fixes to find_class:
1. Only DECREF the class's module when the module is retrieved via
PyImport_Import.  If it is retrieved from the modules dictionary with
PyDict_GetItem, it is using a borrowed reference.

2. If the module doesn't define the desired class, raise the same
SystemError that pickle.py does instead of returning an AttributeError
(which is cryptic at best).

Also, fix the PyArg_ParseTuple in cpm_loads (the externally visible
loads) function:  Use "S" instead of "O" because cStringIO will croak
with a "bad arguments to internal function" if passed anything other
than a string.
1998-08-11 19:52:51 +00:00
Guido van Rossum 549cb6ea03 Added a module docstring (that's all this module needs). 1998-08-11 17:50:22 +00:00
Guido van Rossum be10c20adf Now include Python.h 1998-08-08 20:01:22 +00:00
Guido van Rossum e2d81cd4d7 Jim Fulton's patches to get rid of the class_map(). 1998-08-08 19:40:10 +00:00
Guido van Rossum 617bc19e3d In Win32 version of listdir(), when FindFirstFile() returns
ERROR_FILE_NOT_FOUND, return an empty list instead of raising an
exception.
1998-08-06 03:23:32 +00:00
Guido van Rossum 954e3cab0a Removed unused variables. 1998-08-06 03:21:15 +00:00
Guido van Rossum 227cf764b2 Undo a silly effect of a global substitution: the macintosh panic()
function had a reference to vPySys_WriteStderr(...) -- turn it back
into fprintf(stder, ...).
1998-08-05 13:53:32 +00:00
Guido van Rossum bcc207484a Changes for BeOS, QNX and long long, by Chris Herborth. 1998-08-04 22:53:56 +00:00