summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-18 09:56:22 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-01-18 09:56:22 (GMT)
commit679db4aa99352abc3c9d93dcfc30e772760a43da (patch)
treea03e70818c211151cd9b9482d5f5563d93d9cd07 /Modules
parentff72122184556afae962f32b7d7ac47bb2d5de33 (diff)
downloadcpython-679db4aa99352abc3c9d93dcfc30e772760a43da.zip
cpython-679db4aa99352abc3c9d93dcfc30e772760a43da.tar.gz
cpython-679db4aa99352abc3c9d93dcfc30e772760a43da.tar.bz2
Merged revisions 59985-60000,60002,60005-60007,60009-60042 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r59987 | raymond.hettinger | 2008-01-15 21:52:42 +0100 (Tue, 15 Jan 2008) | 1 line Refactor if/elif chain for clarity and speed. Remove dependency on subclasses having to implement _empty and _full. ........ r59988 | raymond.hettinger | 2008-01-15 22:22:47 +0100 (Tue, 15 Jan 2008) | 1 line Fix-up half-written paragraph in the docs ........ r59989 | amaury.forgeotdarc | 2008-01-15 22:25:11 +0100 (Tue, 15 Jan 2008) | 3 lines test_doctest fails since r59984. Not sure if these are the correct values, but save_stdout has to be set before its usage... ........ r59992 | andrew.kuchling | 2008-01-16 01:32:03 +0100 (Wed, 16 Jan 2008) | 1 line Docstring typos ........ r59993 | andrew.kuchling | 2008-01-16 04:17:25 +0100 (Wed, 16 Jan 2008) | 1 line Add PEP 3141 section ........ r59998 | andrew.kuchling | 2008-01-16 14:01:51 +0100 (Wed, 16 Jan 2008) | 1 line Markup fix ........ r59999 | georg.brandl | 2008-01-16 17:56:29 +0100 (Wed, 16 Jan 2008) | 2 lines Fix MSDN library URL. (#1854) ........ r60006 | georg.brandl | 2008-01-16 21:27:56 +0100 (Wed, 16 Jan 2008) | 3 lines Add Python-specific content to Doc dir. Update configuration file to work with the newest Sphinx. ........ r60007 | georg.brandl | 2008-01-16 21:29:00 +0100 (Wed, 16 Jan 2008) | 2 lines Doc build should work with 2.4 now. ........ r60009 | raymond.hettinger | 2008-01-17 00:38:16 +0100 (Thu, 17 Jan 2008) | 1 line Minor wordsmithing. ........ r60010 | raymond.hettinger | 2008-01-17 00:40:45 +0100 (Thu, 17 Jan 2008) | 1 line Add queues will alternative fetch orders (priority based and stack based). ........ r60011 | raymond.hettinger | 2008-01-17 00:49:35 +0100 (Thu, 17 Jan 2008) | 1 line Add news entry. ........ r60013 | raymond.hettinger | 2008-01-17 04:02:14 +0100 (Thu, 17 Jan 2008) | 1 line Make starmap() match its pure python definition and accept any itertable input (not just tuples). ........ r60015 | gregory.p.smith | 2008-01-17 08:43:20 +0100 (Thu, 17 Jan 2008) | 3 lines Comply with RFC 3207. Fixes issue 829951 - http://bugs.python.org/issue829951 ........ r60018 | gregory.p.smith | 2008-01-17 09:03:17 +0100 (Thu, 17 Jan 2008) | 2 lines entry for r60015 ........ r60019 | raymond.hettinger | 2008-01-17 09:07:05 +0100 (Thu, 17 Jan 2008) | 1 line Note versionadded. ........ r60020 | gregory.p.smith | 2008-01-17 09:35:49 +0100 (Thu, 17 Jan 2008) | 8 lines Fixes (accepts patch) issue1339 - http://bugs.python.org/issue1339 - Factor out the duplication of EHLO/HELO in login() and sendmail() to a new function, ehlo_or_helo_if_needed(). - Use ehlo_or_helo_if_needed() in starttls() - Check for the starttls exception in starttls() in the same way as login() checks for the auth extension. Contributed by Bill Fenner. ........ r60021 | andrew.kuchling | 2008-01-17 13:00:15 +0100 (Thu, 17 Jan 2008) | 1 line Revise 3141 section a bit; add some Windows items ........ r60022 | brett.cannon | 2008-01-17 19:45:10 +0100 (Thu, 17 Jan 2008) | 2 lines Fix a function pointer declaration to silence the compiler. ........ r60024 | raymond.hettinger | 2008-01-17 20:31:38 +0100 (Thu, 17 Jan 2008) | 1 line Issue #1861: Add read-only attribute listing upcoming events in the order they will be run. ........ r60025 | andrew.kuchling | 2008-01-17 20:49:24 +0100 (Thu, 17 Jan 2008) | 1 line Correction from Jordan Lewis: halfdelay() uses tenths of a second, not milliseconds ........ r60026 | raymond.hettinger | 2008-01-17 23:27:49 +0100 (Thu, 17 Jan 2008) | 1 line Add advice on choosing between scheduler and threading.Timer(). ........ r60028 | christian.heimes | 2008-01-18 00:01:44 +0100 (Fri, 18 Jan 2008) | 2 lines Updated new property syntax. An elaborate example for subclassing and the getter was missing. Added comment about VS 2008 and PGO builds. ........ r60029 | raymond.hettinger | 2008-01-18 00:32:01 +0100 (Fri, 18 Jan 2008) | 1 line Fix-up Timer() example. ........ r60030 | raymond.hettinger | 2008-01-18 00:56:56 +0100 (Fri, 18 Jan 2008) | 1 line Fix markup ........ r60031 | raymond.hettinger | 2008-01-18 01:10:42 +0100 (Fri, 18 Jan 2008) | 1 line clearcache() needs to remove the dict as well as clear it. ........ r60033 | andrew.kuchling | 2008-01-18 03:26:16 +0100 (Fri, 18 Jan 2008) | 1 line Bump verson ........ r60034 | andrew.kuchling | 2008-01-18 03:42:52 +0100 (Fri, 18 Jan 2008) | 1 line Typo fix ........ r60035 | christian.heimes | 2008-01-18 08:30:20 +0100 (Fri, 18 Jan 2008) | 3 lines Coverity issue CID #197 var_decl: Declared variable "stm" without initializer ninit_use_in_call: Using uninitialized value "stm" (field "stm".tm_zone uninitialized) in call to function "mktime" ........ r60036 | christian.heimes | 2008-01-18 08:45:30 +0100 (Fri, 18 Jan 2008) | 11 lines Coverity issue CID #167 Event alloc_fn: Called allocation function "metacompile" [model] Event var_assign: Assigned variable "gr" to storage returned from "metacompile" gr = metacompile(n); Event pass_arg: Variable "gr" not freed or pointed-to in function "maketables" [model] g = maketables(gr); translatelabels(g); addfirstsets(g); Event leaked_storage: Returned without freeing storage "gr" return g; ........ r60038 | christian.heimes | 2008-01-18 09:04:57 +0100 (Fri, 18 Jan 2008) | 3 lines Coverity issue CID #182 size_error: Allocating 1 bytes to pointer "children", which needs at least 4 bytes ........ r60041 | christian.heimes | 2008-01-18 09:47:59 +0100 (Fri, 18 Jan 2008) | 4 lines Coverity issue CID #169 local_ptr_assign_local: Assigning address of stack variable "namebuf" to pointer "filename" out_of_scope: Variable "namebuf" goes out of scope use_invalid: Used "filename" pointing to out-of-scope variable "namebuf" ........ r60042 | christian.heimes | 2008-01-18 09:53:45 +0100 (Fri, 18 Jan 2008) | 2 lines Coverity CID #168 leaked_storage: Returned without freeing storage "fp" ........
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/libffi/src/x86/ffi_darwin.c2
-rw-r--r--Modules/_elementtree.c10
-rw-r--r--Modules/_struct.c3
-rw-r--r--Modules/itertoolsmodule.c7
-rw-r--r--Modules/main.c1
-rw-r--r--Modules/zipimport.c2
6 files changed, 19 insertions, 6 deletions
diff --git a/Modules/_ctypes/libffi/src/x86/ffi_darwin.c b/Modules/_ctypes/libffi/src/x86/ffi_darwin.c
index c9742d8..71ac587 100644
--- a/Modules/_ctypes/libffi/src/x86/ffi_darwin.c
+++ b/Modules/_ctypes/libffi/src/x86/ffi_darwin.c
@@ -217,7 +217,7 @@ extern void ffi_call_STDCALL(void (*)(char *, extended_cif *),
#endif /* X86_WIN32 */
void ffi_call(/*@dependent@*/ ffi_cif *cif,
- void (*fn)(),
+ void (*fn)(void),
/*@out@*/ void *rvalue,
/*@dependent@*/ void **avalue)
{
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 97297b8..d237cbb 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -348,7 +348,17 @@ element_resize(ElementObject* self, int extra)
if (size > self->extra->allocated) {
/* use Python 2.4's list growth strategy */
size = (size >> 3) + (size < 9 ? 3 : 6) + size;
+ /* Coverity CID #182 size_error: Allocating 1 bytes to pointer "children"
+ * which needs at least 4 bytes.
+ * Although it's a false alarm always assume at least one child to
+ * be safe.
+ */
+ size = size ? size : 1;
if (self->extra->children != self->extra->_children) {
+ /* Coverity CID #182 size_error: Allocating 1 bytes to pointer
+ * "children", which needs at least 4 bytes. Although it's a
+ * false alarm always assume at least one child to be safe.
+ */
children = PyObject_Realloc(self->extra->children,
size * sizeof(PyObject*));
if (!children)
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 278b035..dcf315e 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1918,8 +1918,7 @@ PyDoc_STRVAR(clearcache_doc,
static PyObject *
clearcache(PyObject *self)
{
- if (cache != NULL)
- PyDict_Clear(cache);
+ Py_CLEAR(cache);
Py_RETURN_NONE;
}
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 132acc5..d35c6b9 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -1356,10 +1356,11 @@ starmap_next(starmapobject *lz)
if (args == NULL)
return NULL;
if (!PyTuple_CheckExact(args)) {
+ PyObject *newargs = PySequence_Tuple(args);
Py_DECREF(args);
- PyErr_SetString(PyExc_TypeError,
- "iterator must return a tuple");
- return NULL;
+ if (newargs == NULL)
+ return NULL;
+ args = newargs;
}
result = PyObject_Call(lz->func, args, NULL);
Py_DECREF(args);
diff --git a/Modules/main.c b/Modules/main.c
index 87462a0..ce05431 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -533,6 +533,7 @@ Py_Main(int argc, char **argv)
if (fstat(fileno(fp), &sb) == 0 &&
S_ISDIR(sb.st_mode)) {
fprintf(stderr, "%s: '%s' is a directory, cannot continue\n", argv[0], filename);
+ fclose(fp);
return 1;
}
}
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index 84985a8..cd56be3 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -1000,6 +1000,8 @@ parse_dostime(int dostime, int dosdate)
{
struct tm stm;
+ memset((void *) &stm, '\0', sizeof(stm));
+
stm.tm_sec = (dostime & 0x1f) * 2;
stm.tm_min = (dostime >> 5) & 0x3f;
stm.tm_hour = (dostime >> 11) & 0x1f;