summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Backport rev 51820 from Thomas HellerNeal Norwitz2006-09-111-2/+2
| | | | | | The cast function did not accept c_char_p or c_wchar_p instances as first argument, and failed with a 'bad argument to internal function' error message.
* Backport rev 51819 from Thomas HellerNeal Norwitz2006-09-111-2/+2
| | | | | | Anonymous structure fields that have a bit-width specified did not work, and they gave a strange error message from PyArg_ParseTuple: function takes exactly 2 arguments (3 given).
* Backport from trunk r51737:Hye-Shik Chang2006-09-073-28/+39
| | | | | | | | | Fixed a few bugs on cjkcodecs: - gbk and gb18030 codec now handle U+30FB KATAKANA MIDDLE DOT correctly. - iso2022_jp_2 codec now encodes into G0 for KS X 1001, GB2312 codepoints to conform the standard. - iso2022_jp_3 and iso2022_jp_2004 codec can encode JIS X 0213:2 codepoints now.
* Backport of r51379 from trunk:Thomas Heller2006-09-061-0/+16
| | | | | | | | | Add asserts to check for 'impossible' NULL values, with comments. In one place where I'm not 1000% sure about the non-NULL, raise a RuntimeError for safety. This should fix the klocwork issues that Neal sent me. If so, it should be applied to the release25-maint branch also.
* Bug #1551427: fix a wrong NULL pointer check in the win32 versionGeorg Brandl2006-09-061-1/+1
| | | | | of os.urandom(). (backport from rev. 51762)
* Backport fix from 51683.Neal Norwitz2006-09-051-0/+4
|
* Backport fix for SF bug #1550714, itertools.tee raises SystemErrorNeal Norwitz2006-09-051-2/+6
|
* Alexander Belopolsky pointed out that pos is a size_tNeal Norwitz2006-08-221-1/+1
|
* Fix a couple of ssize-t issues reported by Alexander Belopolsky on python-devNeal Norwitz2006-08-211-1/+1
|
* Move assert to after NULL check, otherwise we deref NULL in the assert.Neal Norwitz2006-08-191-1/+1
| | | | Klocwork #307
* SF#1534630Fredrik Lundh2006-08-161-1/+5
| | | | ignore data that arrives before the opening start tag
* Remove the special casing of Py_None when converting the return valueThomas Heller2006-08-161-1/+1
| | | | | | | | | | of the Python part of a callback function to C. If it cannot be converted, call PyErr_WriteUnraisable with the exception we got. Before, arbitrary data has been passed to the calling C code in this case. (I'm not really sure the NEWS entry is understandable, but I cannot find better words)
* The __repr__ method of a NULL py_object does no longer raise anThomas Heller2006-08-161-1/+1
| | | | | | | exception. Remove a stray '?' character from the exception text when the value is retrieved of such an object. Includes tests.
* Add commented assert statements to check that the result ofThomas Heller2006-08-161-20/+36
| | | | | | | | PyObject_stgdict() and PyType_stgdict() calls are non-NULL before dereferencing the result. Hopefully this fixes what klocwork is complaining about. Fix a few other nits as well.
* Check for NULL return value from new_CArgObject calls.Thomas Heller2006-08-151-0/+6
|
* Patch #1511317: don't crash on invalid hostname infoGeorg Brandl2006-08-141-11/+14
|
* Patch #1535500: fix segfault in BZ2File.writelines and make sure itGeorg Brandl2006-08-141-2/+17
| | | | raises the correct exceptions.
* Patch #1536908: Add support for AMD64 / OpenBSD.Thomas Heller2006-08-143-3/+2
| | | | | Remove the -no-stack-protector compiler flag for OpenBSD as it has been reported to be unneeded.
* Apply the patch #1532975 plus ideas from the patch #1533481.Thomas Heller2006-08-143-162/+182
| | | | | | | | | | | | | | ctypes instances no longer have the internal and undocumented '_as_parameter_' attribute which was used to adapt them to foreign function calls; this mechanism is replaced by a function pointer in the type's stgdict. In the 'from_param' class methods, try the _as_parameter_ attribute if other conversions are not possible. This makes the documented _as_parameter_ mechanism work as intended. Change the ctypes version number to 1.0.1.
* Revert the change that tries to zero out a closure's result storageThomas Heller2006-08-141-15/+5
| | | | area because the size if unknown in source/callproc.c.
* Check for NULL return value of GenericCData_new().Thomas Heller2006-08-141-0/+4
| | | | Fixes klockwork issues #188, #189.
* Check for NULL return value from new_CArgObject().Thomas Heller2006-08-141-0/+6
| | | | Fixes klockwork issues #183, #184, #185.
* Remove unused, buggy test function.Thomas Heller2006-08-141-12/+0
| | | | Fixes klockwork issue #207.
* Get rid of compiler warningNeal Norwitz2006-08-131-2/+2
|
* Handle alloca failures.Neal Norwitz2006-08-132-0/+15
| | | | Klocwork 225-228
* Really address the issue of where to place the assert for leftblock.Neal Norwitz2006-08-131-1/+1
| | | | (Followup of Klocwork 274)
* Handle failure from PyModule_GetDict() (Klocwork 208).Neal Norwitz2006-08-131-9/+15
| | | | | Fix a bunch of refleaks in the init of the module. This would only be found when running python -v.
* Handle failures from lookup.Neal Norwitz2006-08-131-0/+4
| | | | Klocwork 341-342
* It's very unlikely, though possible that source is not a string. VerifyNeal Norwitz2006-08-131-0/+3
| | | | | | | that PyString_AsString() returns a valid pointer. (The problem can arise when zlib.decompress doesn't return a string.) Klocwork 346
* Handle malloc and fopen failures more gracefully.Neal Norwitz2006-08-131-2/+8
| | | | Klocwork 180-181
* Check return result of PyModule_GetDict().Neal Norwitz2006-08-131-22/+24
| | | | | Fix a bunch of refleaks in the init of the module. This would only be found when running python -v.
* Patch #1538606, Patch to fix __index__() clipping.Neal Norwitz2006-08-123-40/+14
| | | | | | | I modified this patch some by fixing style, some error checking, and adding XXX comments. This patch requires review and some changes are to be expected. I'm checking in now to get the greatest possible review and establish a baseline for moving forward. I don't want this to hold up release if possible.
* Verify verdat which is returned from malloc is not NULL.Neal Norwitz2006-08-121-4/+13
| | | | | | Ensure we don't pass NULL to free. Klocwork #306 (at least the first part, checking malloc)
* Don't deref v if it's NULL.Neal Norwitz2006-08-121-2/+4
| | | | Klocwork #214
* Check returned pointer is valid.Neal Norwitz2006-08-121-0/+6
| | | | Klocwork #233
* I'm not sure why this code allocates this string for the error message.Neal Norwitz2006-08-121-2/+11
| | | | | | | I think it would be better to always use snprintf and have the format limit the size of the name appropriately (like %.200s). Klocwork #340
* Try to handle a malloc failure. I'm not entirely sure this is correct.Neal Norwitz2006-08-121-0/+3
| | | | | | There might be something else we need to do to handle the exception. Klocwork # 212-213
* Move the assert which checks for a NULL pointer first.Neal Norwitz2006-08-121-1/+1
| | | | Klocwork #274.
* If _stat_float_times is false, we will try to INCREF ival which could be NULL.Neal Norwitz2006-08-121-0/+2
| | | | | | | Return early in that case. The caller checks for PyErr_Occurred so this should be ok. Klocwork #297
* Klocwork made another run and found a bunch more problems.Neal Norwitz2006-08-124-2/+12
| | | | | | | This is the first batch of fixes that should be easy to verify based on context. This fixes problem numbers: 220 (ast), 323-324 (symtable), 321-322 (structseq), 215 (array), 210 (hotshot), 182 (codecs), 209 (etree).
* When a ctypes C callback function is called, zero out the resultThomas Heller2006-08-111-7/+17
| | | | | | | | storage before converting the result to C data. See the comment in the code for details. Provide a better context for errors when the conversion of a callback function's result cannot be converted.
* Update dangling references to the 3.2 database toMartin v. Löwis2006-08-101-5/+5
| | | | mention that this is UCD 4.1 now.
* Bug #1535081: A leading underscore has been added to the names ofGeorg Brandl2006-08-061-5/+8
| | | | the md5 and sha modules, so add it in Modules/Setup.dist too.
* Fix #1530559, struct.pack raises TypeError where it used to convert.Bob Ippolito2006-08-041-0/+60
| | | | | Passing float arguments to struct.pack when integers are expected now triggers a DeprecationWarning.
* Change fix for segfaulting property(), add a NEWS entry and a test.Georg Brandl2006-08-041-0/+9
|
* Correction of patch #1455898: In the mbcs decoder, set final=FalseMartin v. Löwis2006-08-021-1/+1
| | | | for stream decoder, but final=True for the decode function.
* Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs duringNeal Norwitz2006-08-021-18/+36
| | | | | a socket operation on a socket with a timeout, the exception will be caught correctly. Previously, the exception was not caught.
* v is already checked for NULL, so just DECREF itNeal Norwitz2006-08-021-1/+1
|
* _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t instead of long.Neal Norwitz2006-08-021-3/+3
|
* Prevent memory leak on error.Neal Norwitz2006-08-021-1/+1
| | | | Reported by Klocwork #36