Commit Graph

1081 Commits

Author SHA1 Message Date
Guido van Rossum f6e8316b01 Initialize __version__ to the correct version string regardless of
what RCS checkout options are used.  Problem first diagnosed by Marc
Lemburg.
1997-12-01 15:57:40 +00:00
Barry Warsaw f577c08683 mymemreplace(), strop_replace(): Add support for optional 4th argument
maxsplit which is implemented in string.py but wasn't here.  The
reference manual doesn't define what happens when maxsplit is negative
or larger than the number of occurrences, but in either case, I
implemented this as all get replaced.  Default value is zero which
replaces all occurrences.
1997-11-29 00:10:07 +00:00
Guido van Rossum 8e9ebfd337 os2 patch by Jeff Rush 1997-11-22 21:53:48 +00:00
Guido van Rossum 8700fe62f8 Redone the _tkinter configuration section with support for popular packages. 1997-11-22 17:35:19 +00:00
Guido van Rossum 7a206c8a05 New tkappinit supporting several popular packages. 1997-11-22 17:34:41 +00:00
Barry Warsaw 0d2d759d8c PySocketSock_methods: Added "connect_ex" so the method can actually be
called!
1997-11-20 21:39:02 +00:00
Guido van Rossum 3df69bca0a Add support for _locale. 1997-11-19 18:57:48 +00:00
Guido van Rossum fc4255db75 Add s.connect_ex() which returns errno instead of raising an exception. 1997-11-19 18:57:13 +00:00
Guido van Rossum aec7497f6f Add optional support fort Tix and BLT. 1997-11-19 18:56:17 +00:00
Guido van Rossum 220ecc8c4b Martin von Loewis' _locale module (locale.py follows tomorrow). 1997-11-18 21:03:39 +00:00
Guido van Rossum 359bcaa539 This fix (across 4 files in 3 directories) solves a subtle problem with
signal handlers in a fork()ed child process when Python is compiled with
thread support.  The bug was reported by Scott <scott@chronis.icgroup.com>.

What happens is that after a fork(), the variables used by the signal
module to determine whether this is the main thread or not are bogus,
and it decides that no thread is the main thread, so no signals will
be delivered.

The solution is the addition of PyOS_AfterFork(), which fixes the signal
module's variables.  A dummy version of the function is present in the
intrcheck.c source file which is linked when the signal module is not
used.
1997-11-14 22:24:28 +00:00
Guido van Rossum 851e7d5159 Got rid of the errorstr dictionary, which is redundant now that
there's os.strerror() -- also, it would form a locale liability.
1997-11-04 20:22:24 +00:00
Guido van Rossum 8f3c812e22 Fix due to Bill Noon for problem discovered by Ken Manheimer: packing
0.0 as float or double would yield the representation for 1.0!
1997-11-04 17:12:33 +00:00
Guido van Rossum 8607ae2e57 Move the Py_{{BEGIN,END}_ALLOW,BLOCK}_THREADS macros in time_sleep()
to inside floatsleep().  This is necessary because floatsleep() does
the error handling and it must have grabbed the interpreter lock and
thread state before it can do so.
1997-11-03 22:04:46 +00:00
Guido van Rossum 7ff20ac9c7 Change the signal finialization so that it also resets the signal
handlers.  After this has been called, our signal handlers are no
longer active!
1997-11-03 21:53:55 +00:00
Guido van Rossum 6345ac6d61 Add cast to realloc/malloc call to shut up AIX compiler. (Vladimir Marangozov) 1997-10-31 20:32:13 +00:00
Guido van Rossum 873c35c437 Take out the setlocale() call. It affects atof() and will break
floating point literals.  Need to do this differently...
1997-10-31 18:25:15 +00:00
Guido van Rossum 86aeb900e5 Add #include "mytime.h", needed for SunOS 4.1 (Matthias Klose). 1997-10-31 16:55:51 +00:00
Guido van Rossum 16cb6f4612 Forgot to add .cxx and .cpp to the second case statement.
Thanks to Daniel Larsson.
1997-10-21 19:30:29 +00:00
Guido van Rossum e85da651dd Some patches to Lee Busby's fpectl mods that accidentally didn't make it
into 1.5a4.
1997-10-20 23:50:01 +00:00
Guido van Rossum f6a84db034 Add getintarg(), getlongarg(), getstrarg() to macros since these no
longer exist in the general headers.
1997-10-20 23:22:07 +00:00
Guido van Rossum cb4d3032ae Add proper (getattrfunc) cast in Pcre_Type. 1997-10-20 23:21:23 +00:00
Guido van Rossum 266033e89b Change sharedmodules to lib-dynload.
### If you still have sharedmodules in your Modules/Setup file, remove it! ###
1997-10-20 23:20:32 +00:00
Guido van Rossum a59406abdf Darn. When thread support is disabled, the BEGIN/END macros don't
save and restore the tstate, but explicitly calling
PyEval_SaveThread() does reset it!  While I think about how to fix
this for real, here's a fix that avoids getting a fatal error.
1997-10-10 17:39:19 +00:00
Guido van Rossum 91922677ea Don Beaudry's changes to support SGI_ABI on Irix 6.x. 1997-10-09 20:24:13 +00:00
Fred Drake d49266eeed Remove requirement for strdup() since it causes so many troubles for too many
platforms.  Argh!
1997-10-09 16:29:31 +00:00
Guido van Rossum 44c36bb114 Add call to setlocale(LC_ALL, ""). 1997-10-08 22:49:17 +00:00
Guido van Rossum 1f14ccf6d1 Put back the extern declaration for strdup(), between #ifndef MS_WINDOWS.
This should make everybody happy, especially since we don't say what
the argument type is (there is disagreement on that, too :-( ).
1997-10-08 15:45:53 +00:00
Guido van Rossum e6a4b7bf3e timezone support for macintosh (Jack) 1997-10-08 15:27:56 +00:00
Guido van Rossum 5bd919b6d7 Include macbuildno.h here (mac only) (Jack) 1997-10-08 15:26:56 +00:00
Guido van Rossum b189a2f997 lots of "goto error" replaced by "return" (Jack) 1997-10-08 15:26:28 +00:00
Guido van Rossum 7dbb48a67f Converted to new exception style (Jack) 1997-10-08 15:26:07 +00:00
Guido van Rossum b0105444e2 Mac does support createfilehandler now (Jack) 1997-10-08 15:25:37 +00:00
Guido van Rossum c386107838 Checking in AMK's latest installement.
(Two small changes to shup up gcc added.)
1997-10-08 02:07:40 +00:00
Fred Drake 0225a38907 initparser(): Use PyErr_NewException() to create the exception. 1997-10-07 19:32:00 +00:00
Guido van Rossum 0e8457c4ec Fix EventHook (the trick to make widgets appear when using GNU
readline) to create and use a new thread state object -- otherwise it
would dump core!
1997-10-07 18:51:41 +00:00
Guido van Rossum 176bb41efa Add the Setup line for the pcre module. 1997-10-07 16:17:55 +00:00
Guido van Rossum 79378ffd91 Add get_line_buffer() and insert_text(), suggested by Michael McLay. 1997-10-07 14:53:21 +00:00
Guido van Rossum 51b3aa3d38 New "re" regular expression support.
This code is written by Philip Hazel and Andrew Kuchling.
It requires a new "re.py" module, too.
1997-10-06 14:43:11 +00:00
Guido van Rossum 88d8beec0a Oops, forgot one. 1997-10-01 04:43:39 +00:00
Guido van Rossum 0cb96de269 Apply two changes, systematically:
(1) Use PyErr_NewException("module.class", NULL, NULL) to create the
    exception object.

(2) Remove all calls to Py_FatalError(); instead, return or
    ignore the errors -- the import code now checks PyErr_Occurred()
    after calling a module's init function, so it's no longer a
    fatal error for the initialization to fail.

Also did some small cleanups, e.g. removed unnecessary test for
"already initialized" from initfpectl(), and unified
initposix()/initnt().

I haven't checked this very thoroughly, so while the changes are
pretty trivial -- beware of untested code!
1997-10-01 04:29:29 +00:00
Fred Drake fd9ef4a26d Removed extern declaration of strdup(). Doesn't appear to be important and
causes ugly noises under Windows.
1997-09-30 19:20:01 +00:00
Guido van Rossum 54e2091ba2 Add an optional hack for threads in Tkinter.
This one works!  However it requires using a modified version of
tclNotify.c (provided), which requires access to the Tcl source
to compile it.  In order to enable this hack, add the following
to the Setup line for _tkinter:
   tclNotify.c -DHAVE_PYTCL_WAITUNTILEVENT -I$(TCL)/generic
where TCL points to the source tree of Tcl 8.0.  Other versions
of Tcl are not supported.

The tclNotify.c file is copyrighted by Sun Microsystems; the
licensing terms are in the file license.terms.  According to this
file, no further permission to distribute this is required,
provided the file license.terms is included.  Hence, I am checking
that in, too.
1997-09-28 05:52:41 +00:00
Guido van Rossum a9f02b8bad Add plat- prefix to MACHDEPPATH, now that it's been removed from MACHDEP. 1997-09-28 05:45:40 +00:00
Guido van Rossum 49f9d8e405 Changes submitted by Marc-Andre Lemburg to add two tables: errorcode
maps errno numbers to errno names (e.g. EINTR), and errorcode maps
them to message strings.  (The latter is redundant because
the new call posix.strerror() now does the same, but alla...)
1997-09-28 05:41:56 +00:00
Guido van Rossum 4518823ad0 In whichmodule(), use __module__ if set. 1997-09-28 05:38:51 +00:00
Guido van Rossum b6c935a933 Set the completer's word break characters appropriate for Python. 1997-09-26 23:00:37 +00:00
Guido van Rossum 290900a5d7 Reordered and reformatted, and added some cool new features:
set_completer(function)
parse_and_bind(string)
read_init_file(filename)

The first is the most exciting feature: with an appropriate Python
completer function, it can do dynamic completion based on the contents
of your namespace!
1997-09-26 21:51:21 +00:00
Guido van Rossum 3bbeb7a318 Fix by Sjoerd: don't want to resize to zero length. 1997-09-22 16:14:27 +00:00
Guido van Rossum 3d26cc9542 Move the "import readline" to an earlier place so it is also done when
"-i" is given.  (Yes, I know, giving in to Marc Lemburg who wanted
this :-)
1997-09-16 16:11:28 +00:00
Guido van Rossum b6a4716298 Add strerror() interface. 1997-09-15 22:54:34 +00:00
Guido van Rossum 83551bfeda Export names for the types defined by this module: TkappType and TkttType. 1997-09-13 00:44:23 +00:00
Guido van Rossum 75626a3b93 Indent the #error so that a strict K&R cpp doesn't complain. 1997-09-08 02:04:00 +00:00
Guido van Rossum ab61c6b290 Change the names of the subdirectories tkinter and stdwin to
lib-tk and lib-stdwin.  (BTW this was also done in the previous
checkin of (toplevel)/Makefile.in, though not noted in the checkin
message.)
1997-09-08 01:54:43 +00:00
Guido van Rossum 970f5d33c7 Reverse the order in which Setup and Setup.local are passed to the
makesetup script.  (Sorry Sjoerd -- I know you proposed this a while
ago and I didn't think it would work then.  I looked again and it
does work.)
1997-09-07 16:44:37 +00:00
Guido van Rossum 9eb671fac3 Contribution by Hannu Krosing (with some changes).
Added 'p' format character for Pascal string (i.e. leading length
byte).  This uses the count prefix line 's' does, except that the
count includes the length byte; i.e. '10p' takes 10 bytes packed but
has space for a length byte and 9 data bytes.
1997-09-05 07:08:39 +00:00
Guido van Rossum bd4435abcc Don't use ANSI string literal concatenation (everything is K&R compatible). 1997-09-05 07:01:19 +00:00
Guido van Rossum 8102c005e0 Get rid of most silly #include and #ifdefs near the top; these are all
obsolete now it includes Python.h.

Make all functions K&R compatible (Sue Williams).
1997-09-05 01:48:48 +00:00
Jeremy Hylton cb91404890 Several changes:
1. Fix bug in (de)compression objects.  The final string resize used
zst.total_out to determine the length of the string, but the
(de)compression object will output data a little bit at a time, which
means total_out is not the string size.  Fix: save original value of
total_out at the start of the call.

2. Be sure to Py_DECREF the result value if you exit with an
exception.

3. Use PyInt_FromLong instead of Py_BuildValue

4. include more constants from the zlib header file

5. Use PyErr_Format instead of using a local buffer and sprintf.
1997-09-04 23:39:23 +00:00
Barry Warsaw c7736b9d49 Added first line to set Emacs makefile mode (pretty colors :-) 1997-09-04 13:05:14 +00:00
Guido van Rossum 9efe8ef7a1 #Plug small memory leaks in constructors. 1997-09-03 18:19:40 +00:00
Guido van Rossum c3beda2f27 Plug small leaks: the [de]compress object itself was never freed. 1997-09-03 18:14:30 +00:00
Guido van Rossum d19c04a88e Change [_Py_]re_compile_pattern() to return a char*.
Since it only returns an error message (or NULL) there's no reason
for it to be unsigned char *, and various compilers like this better.
1997-09-03 00:47:36 +00:00
Guido van Rossum 5ade084902 Mod suggested by Donn Cave -- invoke makexp_aix relative to $0
so it doesn't have to be on $PATH.
1997-09-03 00:45:30 +00:00
Guido van Rossum 3f0bff666d Disable the portable multimedia modules (audioop, imageop, rgbimg) by
default since they don't work on 64-bit platforms.
1997-09-03 00:44:14 +00:00
Guido van Rossum 15a40394b0 Fix the bug Jeremy was experiencing: both the close() and the
dealloc() functions contained code to free/DECREF the buffer
(there were differences between I and O objects but the logic bug was
the same).  Fixed this be setting the buffer pointer to NULL and
testing for that.  (This also makes it safe to call close() more than
once.)

XXX Worry: what if you try to read() or write() once the thing is
closed?
1997-09-03 00:09:26 +00:00
Guido van Rossum 7922bd7382 Added -X option to suppress default import of site.py. Also split the
usage message in *three* parts under 510 bytes, for low-end ANSI
compatibility.
1997-08-29 22:34:47 +00:00
Barry Warsaw 83b6709d8e Swap the sense of the -X option vis-a-vis Py_UseClassExceptionsFlag so
that class based exceptions are enabled by default.  -X disables them
in favor of the old-style string exceptions.
1997-08-29 22:20:16 +00:00
Barry Warsaw f488af3360 Parse new command line option -X which enables exception classes. 1997-08-29 21:57:49 +00:00
Guido van Rossum c1f088201f Added (binaryfunc) casts to function pointers in method lists. 1997-08-28 21:21:22 +00:00
Guido van Rossum 24a49941b3 Some long variables should have been int to match the 'i' format specifier. 1997-08-28 18:11:05 +00:00
Guido van Rossum e20aef574a Ignore whitespace between formats (not internal to a count+format). 1997-08-26 20:39:54 +00:00
Guido van Rossum d14c06819e Add unsupported variable EXE which can be set to .exe on systems where
the executable must have that suffix.  Note that there is no
corresponding support in the top-level Makefile because I'm not sure
that the install targets there make sense under these circumstances.
1997-08-22 20:53:47 +00:00
Guido van Rossum 1171ee6aaf Added configuration tests for presence of alarm(), pause(), and getpwent() 1997-08-22 20:42:00 +00:00
Barry Warsaw 779133c707 Removed JF's dollar-Log-dollar RCS turd that caused compilation to
crash due to GvR's last check in message :-).  Will try to convince JF
to remove all this evilness.
1997-08-21 22:36:26 +00:00
Guido van Rossum d7a7100c99 Remove redundant decl for PyOS_InputHook. 1997-08-21 17:26:04 +00:00
Guido van Rossum c6ef204830 Added /**/ around #end tags 1997-08-21 02:30:45 +00:00
Guido van Rossum bae6523a75 Must remove conflicting files from archive
*before* adding signalmodule.o, because some ar programs
are too smart for us...
1997-08-21 02:30:20 +00:00
Guido van Rossum 6b9fdf529a Globally renamed join() to joinpath() to avoid compilation error on Cray. 1997-08-20 23:48:16 +00:00
Guido van Rossum 725d941f0f Renamed strndup to pystrndup, to avoid conflicting prototype
in GNU libc on some platforms.
1997-08-20 23:38:57 +00:00
Guido van Rossum 4f46fc6d57 When we have signalmodule.o, remove intrcheck.o as well as sigcheck.o. 1997-08-20 22:45:52 +00:00
Guido van Rossum 5b02078e31 Alas, the thread support for Tk didn't work. Withdraw it, until I
figure out how to do this right.
1997-08-19 01:00:50 +00:00
Guido van Rossum 25f93036bb Moved inclusion of PURIFY in LINKCC to configure 1997-08-18 16:00:04 +00:00
Guido van Rossum ed2554a396 Casts by Jack to shut up the Mac compiler. 1997-08-18 15:31:24 +00:00
Guido van Rossum bad3c013d2 DeleteTimerHandler was accidentally #ifdef'ed out for macintosh with
Tk 8.0; this was a mistake.
1997-08-18 15:28:52 +00:00
Guido van Rossum 79fa8b0abe When making all, don't make sharedmods. That's now called separately
from the toplevel Makefile.  (For AIX, but doesn't hurt elsewhere.)
1997-08-18 14:23:13 +00:00
Guido van Rossum 57e846f803 Use a trick to make the test for GMP v2 to work when GMP v1 defines
__GNU_MP__ as empty: #if __GNU_MP__ + 0 == 2
(Untested.)
1997-08-17 19:08:33 +00:00
Guido van Rossum 607b33a1fe Different strategy regarding whether to declare getrusage() and
getpagesize() -- #ifdef doesn't work, Linux has conflicting decls in
its headers.  Choice: only declare the return type, not the argument
prototype, and not on Linux.
1997-08-17 16:24:30 +00:00
Guido van Rossum 53665e571f Last minute changes for \B. AMK. 1997-08-15 15:45:25 +00:00
Guido van Rossum 7c14103d77 Keep gcc -Wall happy 1997-08-15 02:52:08 +00:00
Guido van Rossum f84a539d38 Added std copyright notice. 1997-08-15 00:04:24 +00:00
Guido van Rossum f1c018de87 Fixed refcount bug (thank you, Purify and AMK). 1997-08-14 21:19:13 +00:00
Jeremy Hylton 644c17d2af Several bug fixes.
-- initialize length to DEFAULTALLOC and not 0
 -- resize string before returning (to remove '\000' padding)

Also converted some compression routines to use PyString instead of
buffer.
1997-08-14 21:06:42 +00:00
Guido van Rossum 6d8841c079 Added a bunch of XXX comments about things I'd like to see changed... 1997-08-14 19:57:39 +00:00
Guido van Rossum 0d2390c549 Merge Mac and Windows mods (which mostly affect the same problem -- no
usable createfilehandler).  Define HAVE_CREATEFILEHANDLER to test
later.  Also other Mac specific patches by Jack.
1997-08-14 19:57:07 +00:00
Guido van Rossum 0318bd6ae6 Use _Py_re_match/search instead of re_match/search; these may become
different in a future version.
1997-08-14 14:35:12 +00:00
Jeremy Hylton 41b9f00e8f Many changes.
Change default alloc size for uncompressing to 16K.

Remove comment about core dumps when an invalid window sizes is used.
This bug has been fixed in zlib 1.0.4.

Two new optional arguments to decompress, wbits and bufsize.  wbits
specifies the window size and bufsize specifies the initial output
string size.

In decompression code -- decompress and decompressobj methods -- use a
Python string (and _PyString_Resize) to collect the uncompressed
stream.  Replaces a separate buffer that was copied into a string.

Fix bug in decompress that caused it to always realloc the buffer when
it was finished decompressing.

Modernized handling of optional arguments to compressobj.

Updated doc strings.
1997-08-13 23:19:55 +00:00
Guido van Rossum 95e8053a9f 1.5a3 prerelease 1 from AMK 1997-08-13 22:34:14 +00:00
Jeremy Hylton a74ef66ac8 Must update the available space in the output buffer after
realloc. (Fixed in PyZlib_unflush.)
1997-08-13 21:39:18 +00:00
Guido van Rossum abed54ab4a Fix bug with \< (AMK). 1997-08-13 16:35:04 +00:00