Commit Graph

1174 Commits

Author SHA1 Message Date
Barry Warsaw d58d7647f3 Several changes to support inclusion of filename in relevent
exceptions:

posix_error_with_filename(): New function which calls
PyErr_SetFromErrnoWithFilename()

The following methods have been changed to call
posix_error_with_filename():

    posix_1str()
    posix_strint()
    posix_strintint()
    posix_do_stat()
    posix_mkdir()
    posix_utime()
    posix_readlink()
    posix_open()

INITFUNC(): os.error (nee PosixError) is PyExc_OSError
1998-07-23 16:14:40 +00:00
Barry Warsaw 1ee36ffca0 (pause_doc): Sun CC complains about newline in string literal 1998-07-21 22:41:18 +00:00
Guido van Rossum 1a78553093 Add test for failure of the getattr call in pcre_expand() -- it used
to core dump if the first argument did not have a "group" attribute.
1998-07-17 20:19:48 +00:00
Fred Drake 7589b71c4a I_getattr(),
O_getattr():  Added read-only access to the closed attribute, based on comment
	from Michael Scharf <Michael.Scharf@Rhein-Neckar.de>.
1998-07-17 14:30:58 +00:00
Guido van Rossum 43ff8683fe Temporarily get rid of the registration of Tcl_Finalize() as a
low-level Python exit handler.  This can attempt to call Python code
at a point that the interpreter and thread state have already been
destroyed, causing a Bus Error.  Given the intended use of
Py_AtExit(), I'm not convinced that it's a good idea to call it
earlier during Python's finalization sequence...  (Although this is
the only use for it in the entire distribution.)
1998-07-14 18:02:13 +00:00
Guido van Rossum 7859f87fdb Marc-Andre Lemburg's patch to support instance methods with other
callable objects than regular Pythonm functions as their im_func.
1998-07-08 14:58:16 +00:00
Guido van Rossum c821d1ecc0 Add a cast that a picky SGI compiler found was necessary. 1998-07-07 22:25:47 +00:00
Guido van Rossum 9f29990a90 Fix a benign problem found by a picky SGI compiler (unreachable break
after a return).
1998-07-07 22:23:22 +00:00
Guido van Rossum 04e00a4cf4 Fix benign problems found by a picky SGI compiler (unreachable break
after a return or goto).
1998-07-07 22:22:22 +00:00
Guido van Rossum c69bac539c Fix benign problems found by a picky SGI compiler (unreachable break
after a return).
1998-07-07 22:21:45 +00:00
Guido van Rossum eaa1ed6b42 Fix some problems that a picky SGI compiler reported. Two were benign
(unreachable break after a return) but one was a real bug:
ReadFrames() was getting a bogus framecount because of a missing '&'.
1998-07-07 22:19:27 +00:00
Guido van Rossum 82a5c66a51 Added copious docstrings, plus two minor layout tweaks. 1998-07-07 20:45:43 +00:00
Guido van Rossum d20781b518 On Windows, put the select file descriptor arrays on the heap.
This is because they are huge and the stack is limited on Windows.
Other platforms keep declaring it on the stack.
1998-07-02 02:53:36 +00:00
Guido van Rossum 39ef2274a3 Unsigned 1 and 2 byte sized formats shouldn't result in long integer values! 1998-06-29 04:00:40 +00:00
Guido van Rossum 911ec188c8 # Added missing semicolon (was #ifdef'ed out in edit on Windows). 1998-06-28 17:00:19 +00:00
Guido van Rossum 1d8fb2d894 Added doc strings. 1998-06-28 16:54:49 +00:00
Guido van Rossum 0ef577b966 Added doc strings. 1998-06-27 20:38:36 +00:00
Guido van Rossum d2264bb5c3 # Remove an extra blank line from a doc string. 1998-06-27 19:45:17 +00:00
Guido van Rossum 75e9fc31d3 Added doc strings. Also export LockType from the modoule, and give it
a doc string.
1998-06-27 18:21:06 +00:00
Guido van Rossum 5cd70f4f66 Added <ctype.h>, needed for Windows. 1998-06-19 04:33:30 +00:00
Guido van Rossum f766e23f63 There was an error check in a loop in PythonCmd which called
PythonCmd_Error() but failed to return.  The error wasn't very likely
(only when we run out of memory) but since the check is there we might
as well return the error.  (I think that Barry introduced this buglet
when he added error checks everywhere.)
1998-06-19 04:28:10 +00:00
Guido van Rossum 5e97783c8f # Note: a previous checkin message was lost because I can now use CVS
# from my PC at home, but it can't send email :-(

Add a clarifying comment about the new ENTER_OVERLAP and
LEAVE_OVERLAP_TCL macros; get rid of all the bogus tests for deleted
interpreters (Tcl already tests for this; they were left over from an
earlier misguided attempt to fix the threading).
1998-06-15 14:03:52 +00:00
Guido van Rossum 62320c9b9b # (My first checkin from Windows NT using remote CVS!)
There were some serious problem with the thread-safety code.
The basic problem was that often the result was gotten out of
the Tcl interpreter object after releasing the Tcl lock.
Of course, another thread might have changed the return value
already, and this was indeed happening.  (Amazing what trying
it on a different thread implementation does!)

The solution is to grab the Python lock without releasing the
Tcl lock, so it's safe to create a string object or set the
exceptions from the Tcl interpreter.  Once that's done, the
Tcl lock is released.

Note that it's now legal to acquire the Python lock while the
the Tcl lock is held; but the reverse is not true: the Python
lock must be released before the Tcl lock is acquired.  This
in order to avoid deadlines.  Fortunately, there don't seem to
be any problems with this.
1998-06-15 04:36:09 +00:00
Guido van Rossum ad4db17552 Fixed the EventHook() code so that it also works on Windows, sort of.
(The "sort of" is because it uses kbhit() to detect that the user
starts typing, and then no events are processed until they hit
return.)

Also fixed a nasty locking bug: EventHook() is called without the Tcl
lock set, so it can't use the ENTER_PYTHON and LEAVE_PYTHON macros,
which manipulate both the Python and the Tcl lock.  I now only acquire
and release the Python lock.

(Haven't tested this on Unix yet...)
1998-06-13 13:56:28 +00:00
Guido van Rossum b3f9f4b729 On Windows, make the pipe() call return Unix file descriptors instead
of Windows file handles.  Now it is at least compatible with itself on
Unix!
1998-06-12 15:05:15 +00:00
Guido van Rossum e7c4193755 In tcsetattr(), first initialize the mode structure by calling
tcgetattr().  This seems to be the only correct way to cope with
platform-specific structure members...
1998-06-12 14:26:18 +00:00
Guido van Rossum 87ce7bbc39 Added strptime, if it exists. Modified after a patch by Jesse Hallio. 1998-06-09 16:30:31 +00:00
Guido van Rossum 3c8c5981b1 Sorry, the initializer for ob_type must really be NULL,
else the damn thing won't compile on Windows :-(
1998-05-29 02:58:20 +00:00
Guido van Rossum 2a5119b680 On Windows, need #include <windows.h>; and it's MS_WINDOWS, not MS_WIN32. 1998-05-29 01:28:40 +00:00
Guido van Rossum 00d93066b0 Changes to make it possible to write multi-threaded programs using
Tkinter.  This adds a separate lock -- read the comments.  (This was
also needed for Mark Hammond's attempts to make PythonWin
Tkinter-friendly.)

The changes have affected the EventHook slightly, too; and I've done
some more cleanup of the code that deals with the different versions
of Tcl_CreateFileHandler().
1998-05-28 23:06:38 +00:00
Guido van Rossum 578de30fd7 Some systems (e.g. Linux) use enums for some symbols (like IPPROTO_IP)
so that our #ifdef test has the wrong effect.  Substitute hardcoded
values for some important symbols (but not for the whole range -- some
are pretty obscure so it's not worth it).
1998-05-28 20:18:18 +00:00
Fred Drake d3dbb38e98 get_long(): Use PyErr_ExceptionMatches(...) instead of PyErr_Occurred(...). 1998-05-28 04:35:49 +00:00
Fred Drake bebc97fcd7 t_bootstrap(): Use PyErr_ExceptionMatches(...) instead of PyErr_Occurred(...). 1998-05-28 04:35:12 +00:00
Fred Drake 764b984db5 Use PyErr_ExceptionMatches(...) instead of PyErr_Occurred() == ... in two
places.
1998-05-28 04:33:37 +00:00
Guido van Rossum 7bf15648a4 Use a different implementation of EventHook(). The new version
registers an input file handler for stdin with Tcl and handles Tcl
events until something is available on stdin; it then deletes the
handler and returns from EventHook().

This works with or without GNU readline, and doesn't busy-wait.

It still doesn't work for Mac or Windows :-(
1998-05-22 18:28:17 +00:00
Guido van Rossum 832f6d2890 Add an alias (and preferred name) "contains" for "sequenceIncludes".
Rationalized the doc strings.

Also simplify the module initialization -- we don't need a __version__
which is set to "$Rev" :-) and we don't need a fatal error when the
initialization fails.
1998-05-22 18:12:59 +00:00
Guido van Rossum b88679b2a4 I think there was a tiny bug in new_function() -- the 'defaults'
argument was initialized to Py_None, but later checked for NULL.
Consistently use Py_None.
1998-05-22 00:57:31 +00:00
Guido van Rossum b1ed9c5295 PySequence_In() -> PySequence_Contains(). 1998-05-22 00:54:16 +00:00
Guido van Rossum 7df115de65 Make sure that no use of a function pointer gotten from a
tp_as_sequence or tp_as_mapping structure is made without checking it
for NULL first.
1998-05-22 00:53:47 +00:00
Guido van Rossum a88c5f30c7 Correct bug doc string (discovered by Berthold Hoellmann):
get_line_buffer() does not take an optional argument.
1998-05-20 15:50:56 +00:00
Guido van Rossum fa1fb7df31 When a .o file is an absolute pathname, assume it's a file for which
we have no .c source.
1998-05-14 02:37:45 +00:00
Guido van Rossum 4ccda15cd3 strop_replace(): balk if the pattern string is empty. 1998-05-14 02:36:29 +00:00
Guido van Rossum ed33a3f415 whichmodule(): remove redundant PyErr_Clear(); add explicit setting
of error when sys.modules isn't there.
1998-05-14 02:34:46 +00:00
Guido van Rossum 02759c03f1 Don't delete glmodule.c on 'make clobber' (it's a checked in file!). 1998-05-14 02:33:57 +00:00
Guido van Rossum b41addf6a6 Replace all calls to fprintf(stderr, ...) with calls to PySys_WriteStderr(...). 1998-05-12 15:02:41 +00:00
Guido van Rossum 597ac20708 Trivial little change: timer tokens shouldn't have a Print() function,
they should have a Repr() function.
1998-05-12 14:36:19 +00:00
Fred Drake ed3da23e44 parser_compare_nodes(): Corrected a minor type error; eliminate one GCC
warning (at least under Linux).
1998-05-11 03:31:16 +00:00
Guido van Rossum ae94cf292b Fix by Sean Reifschneider:
- When facility not specified to syslog() method, use default from openlog()
    (This is how it was claimed to work in the documentation)
  - Potential resource leak of o_ident, now cleaned up in closelog()
  - Minor comment accuracy fix.
1998-05-08 21:52:55 +00:00
Guido van Rossum 821a5e42bf Added URLs for zlib's home page and the Windows DLL's home page . 1998-05-08 14:56:29 +00:00
Guido van Rossum dda6696be6 AMK's revised version of the previous patch. 1998-05-07 15:32:44 +00:00