Guido van Rossum
42e8e5d164
Protect PyErr_Format format string argument from overflow.
1998-01-19 22:23:08 +00:00
Guido van Rossum
0d6b49eff2
Protect PyErr_Format format string argument from overflow (ironically,
...
the error was about a bad format string :-).
1998-01-19 22:22:44 +00:00
Guido van Rossum
73bacfc3d7
Add unistd.h for isatty().
1998-01-19 22:05:22 +00:00
Guido van Rossum
15af20a337
Better #ifdefs for NetBSD, taking into account that at least on netBSD
...
1.3, dlopen() etc. are fully implemented, including dlerror().
From Jaromir Dolecek and Ty Sarna.
1998-01-19 22:03:52 +00:00
Guido van Rossum
4cc462e85b
It seems obvious that when Py_Finalize() decides that there's nothing
...
to do, it should not call sys.exitfunc either...
1998-01-19 22:00:38 +00:00
Guido van Rossum
758eec0172
Rewritten PyImport_Cleanup() and its helper, clear_carefully(). They
...
now implement the following finalization strategy.
1. Whenever this code deletes a module, its directory is cleared
carefully, as follows:
- set all names to None that begin with exactly one underscore
- set all names to None that don't begin with two underscores
- clear the directory
2. Modules are deleted in the following order:
- modules with a reference count of 1, except __builtin__ or __sys__
- repeat until no more are found with a reference count of 1
- __main__ if it's still there
- all remaining modules except __builtin__ or sys
- sys
_ __builtin__
1998-01-19 21:58:26 +00:00
Guido van Rossum
8f18320270
Last-minute fix for Jim H: don't die after del sys.stdout
1997-12-31 05:53:15 +00:00
Guido van Rossum
aa06b0ede5
Plug the most annoying recursive printing problem -- reset '_' to None
...
before printing and set it to the printed variable *after* printing
(and only when printing is successful).
1997-12-26 22:15:57 +00:00
Guido van Rossum
7d4f68c15f
Oops -- '(' is also a legal start character of a new format...
1997-12-19 04:25:23 +00:00
Guido van Rossum
e8c27bb3ea
Oops! Should've renamed dos_8x3 to dos-8x3 here, too.
1997-12-17 18:57:16 +00:00
Guido van Rossum
330aafb0c2
For base 10, cast unsigned long to long before testing overflow.
...
This prevents 4294967296 from being an acceptable way to spell zero!
1997-12-15 17:27:35 +00:00
Guido van Rossum
d6af46d4ae
Need a cast when comparing type object in isinstance()
1997-12-10 05:51:47 +00:00
Guido van Rossum
231a41e708
Add explicit check for correct next character in format at end of
...
format. This will complain about illegal formats like "O#" instead of
ignoring the '#'.
1997-12-09 20:36:39 +00:00
Guido van Rossum
19b55f2d17
Fix subtle bug in cleanup code in PyErr_NormalizeException(), detected
...
by Marc Lemburg. There's a path through the code where *val is NULL,
but value isn't, and value should be DECREF'ed.
1997-12-09 14:11:39 +00:00
Guido van Rossum
1707aad27c
Changed the finalization order again so that the reference count
...
printing (when Py_DEBUG is defined) happens while there's still a
current thread...
1997-12-08 23:43:45 +00:00
Guido van Rossum
595d7ba069
Jeff Rush: add definition for S_IFMT for VisualAge C/C++ under OS2.
1997-12-05 21:45:29 +00:00
Guido van Rossum
08052c7bb6
Add the flag RTLD_GLOBAL to the dlopen() options.
...
This exports symbols defined by the loaded extension to other
extensions (loaded later).
(I'm not quite sure about this but suppose it can't hurt...)
1997-12-02 20:43:18 +00:00
Guido van Rossum
c425d2f87b
Make stdin unbuffered too, when PYTHONUNBUFFERED is specified.
1997-12-02 20:41:39 +00:00
Guido van Rossum
f5dd914196
Support type objects in isinstance().
...
E.g. isinstance('',types.StringType) will return true now instead of
raising a TypeError exception. This is for JPython compatibility.
1997-12-02 19:11:45 +00:00
Guido van Rossum
ddc3fb5734
Apply str() to sys.ps1 or sys.ps2 before using them as a prompt, so
...
you can assign an object whose str() evaluates to the current
directory (or whatever).
1997-11-25 20:58:13 +00:00
Guido van Rossum
8e9ebfd337
os2 patch by Jeff Rush
1997-11-22 21:53:48 +00:00
Guido van Rossum
db847bd9ea
Plug memory leak in Py_BuildValue when using {...} to construct dictionaries.
1997-11-20 20:35:45 +00:00
Guido van Rossum
2e58ff3ef5
Fix importing of shared libraries from inside packages.
...
This is a bit of a hack: when the shared library is loaded, the module
name is "package.module", but the module calls Py_InitModule*() with just
"module" for the name. The shared library loader squirrels away the true
name of the module in _Py_PackageContext, and Py_InitModule*() will
substitute this (if the name actually matches).
1997-11-19 18:53:33 +00:00
Guido van Rossum
858cb73bb2
Two changes (here we go again :-( ).
...
1) The __builtins__ variable in the __main__ module is set to the
__builtin__ module instead of its __dict__.
2) Get rid of the SIGHUP and SIGTERM handlers. They can't be made to
work reliably when threads may be in use, they are Unix specific, and
Python programmers can now program this functionality is a safer way
using the signal module.
1997-11-19 16:15:37 +00:00
Guido van Rossum
df9db1ea18
Give more detailed error message when the argument count isn't right.
1997-11-19 16:05:40 +00:00