Neal Norwitz
0c6ae5bad4
Handle a few more error conditions.
...
Klocwork 301 and 302. Will backport.
2006-08-21 20:16:24 +00:00
Neal Norwitz
0f7dbf731a
PyModule_GetDict() can fail, produce fatal errors if this happens on startup.
...
Klocwork #298-299.
2006-08-12 03:17:41 +00:00
Neal Norwitz
421c1319ad
Whoops, how did that get in there. :-) Revert all the parts of 51227 that were not supposed to go it. Only Modules/_ctypes/cfields.c was supposed to be changed
2006-08-12 02:12:30 +00:00
Neal Norwitz
6b4953fd3d
Check returned pointer is valid.
...
Klocwork #233
2006-08-12 02:06:34 +00:00
Neal Norwitz
b59d08c2fb
Fix more memory allocation issues found with failmalloc.
2006-07-22 16:20:49 +00:00
Neal Norwitz
d12bd012a6
Handle more memory allocation failures without crashing.
2006-07-21 07:59:47 +00:00
Neal Norwitz
a5e4f22bfb
Reported by Klocwork #151 .
...
v2 can be NULL if exception2 is NULL. I don't think that condition can happen,
but I'm not sure it can't either. Now the code will protect against either
being NULL.
2006-07-17 00:59:04 +00:00
Martin v. Löwis
0e8bd7e1cc
Patch #1495999 : Part two of Windows CE changes.
...
- update header checks, using autoconf
- provide dummies for getenv, environ, and GetVersion
- adjust MSC_VER check in socketmodule.c
2006-06-10 12:23:46 +00:00
Tim Peters
5e9d6cfbda
PyErr_Display(), PyErr_WriteUnraisable(): Coverity found a cut-and-paste
...
bug in both: `className` was referenced before being checked for NULL.
2006-05-28 10:41:29 +00:00
Richard Jones
7b9558d37d
Conversion of exceptions over from faked-up classes to new-style C types.
2006-05-27 12:29:24 +00:00
Thomas Heller
1b04664eab
Change those parts of the Python-api that were functions in 2.4, and
...
are now macros to exported functions again.
Fixes [ 1465834 ] bdist_wininst preinstall script support is broken in 2.5a1.
2006-04-18 18:51:06 +00:00
Martin v. Löwis
45294a9562
Remove types from type_list if they have no objects
...
and unlist_types_without_objects is set.
Give dump_counts a FILE* argument.
2006-04-18 06:24:08 +00:00
Anthony Baxter
ac6bd46d5c
spread the extern "C" { } magic pixie dust around. Python itself builds now
...
using a C++ compiler. Still lots and lots of errors in the modules built by
setup.py, and a bunch of warnings from g++ in the core.
2006-04-13 02:06:09 +00:00
Armin Rigo
e170937af6
Ignore the references to the dummy objects used as deleted keys
...
in dicts and sets when computing the total number of references.
2006-04-12 17:06:05 +00:00
Martin v. Löwis
ea62d2535f
Bug #1421664 : Set sys.stderr.encoding
2006-04-03 10:56:49 +00:00
Tim Peters
62e97f023b
In format strings slinging Py_ssize_t, unconditionally
...
interpolate PY_FORMAT_SIZE_T instead of #if'ing on
MS_WIN64.
2006-03-28 21:44:32 +00:00
Tim Peters
c9d78aa470
Years in the making.
...
objimpl.h, pymem.h: Stop mapping PyMem_{Del, DEL} and PyMem_{Free, FREE}
to PyObject_{Free, FREE} in a release build. They're aliases for the
system free() now.
_subprocess.c/sp_handle_dealloc(): Since the memory was originally
obtained via PyObject_NEW, it must be released via PyObject_FREE (or
_DEL).
pythonrun.c, tokenizer.c, parsermodule.c: I lost count of the number of
PyObject vs PyMem mismatches in these -- it's like the specific
function called at each site was picked at random, sometimes even with
memory obtained via PyMem getting released via PyObject. Changed most
to use PyObject uniformly, since the blobs allocated are predictably
small in most cases, and obmalloc is generally faster than system
mallocs then.
If extension modules in real life prove as sloppy as Python's front
end, we'll have to revert the objimpl.h + pymem.h part of this patch.
Note that no problems will show up in a debug build (all calls still go
thru obmalloc then). Problems will show up only in a release build, most
likely segfaults.
2006-03-26 23:27:58 +00:00
Guido van Rossum
9d7855076a
Address an coverity issue. Coverity was complaining about a line that's fine,
...
but an earlier line checked for v != NULL unnecessarily.
2006-03-07 18:31:44 +00:00
Neal Norwitz
f2e0c45492
Fix warnings on x86 (32-bit).
2006-03-06 23:31:27 +00:00
Martin v. Löwis
99b93c2824
Use %Id for size_t-ish things on Win64.
2006-03-05 05:33:54 +00:00
Neal Norwitz
4281cef205
Use Py_ssize_t for _Py_RefTotal.
...
I tried to handle Win64 properly, but please review.
2006-03-04 19:58:13 +00:00
Neal Norwitz
9589ee276a
Tabify
2006-03-04 19:01:22 +00:00
Neal Norwitz
e92fba0a12
Get rid of run_err_mod(). It was only used in two places.
...
One place it wasn't necessary since mod was already checked.
Inline the check that mod != NULL for the other use.
2006-03-04 18:52:26 +00:00
Brett Cannon
2e63b73a2c
Fix refleak in PyErr_Display().
2006-03-02 18:34:57 +00:00
Martin v. Löwis
056a69cba6
Reconst parameters that lost their const in the AST merge.
2006-03-01 16:55:42 +00:00