summaryrefslogtreecommitdiffstats
path: root/Modules/cPickle.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #7092: Remove py3k warning when importing cPickle. 2to3 handlesAntoine Pitrou2010-01-081-6/+0
| | | | | | renaming of `cPickle` to `pickle`. The warning was annoying since there's no alternative to cPickle if you care about performance. Patch by Florent Xicluna.
* Issue #7455: Fix possible crash in cPickle on invalid input. Patch byAntoine Pitrou2010-01-071-1/+1
| | | | Florent Xicluna.
* Issue 7128: Removed reference to the non-existent copyreg module.Alexandre Vassalotti2009-11-241-3/+2
| | | | | | | | | The reference to copyreg was a unnoticed leftover from the compatibility support for the grand renaming of the standard library in Python 3. The compatibility support was reverted in r63493, but not completely as this patch shows. Based on a patch by Amaury Forgeot d'Arc.
* Issue 7117: Replace PyOS_ascii_strtod with PyOS_string_to_double in cPickle ↵Eric Smith2009-10-271-4/+4
| | | | as part of short float repr.
* Continue removing _PyOS_double_to_string, as mentioned in issue 7117.Eric Smith2009-10-261-8/+22
|
* Make cPickle.Unpickler.noload() handle dict subclasses. noload() isNeil Schemenauer2009-10-141-4/+31
| | | | | an obscure, undocumentated feature so no test was added. Closes issue #1101399.
* #6553: crash in cPickle.load(), when given a StringIO with incomplete data.Amaury Forgeot d'Arc2009-07-231-0/+6
| | | | Will backport to 2.6, 3.x already fixed a similar issue with issue4298.
* Issue 5794: fix cPickle's unpickling of recursive tuples.Collin Winter2009-05-261-10/+9
|
* Issue 5670: special-case pickling of dicts. This nearly doubles the ↵Collin Winter2009-05-251-9/+78
| | | | performance of dict pickling in cPickle.
* Isue #5084: unpickling now interns the attribute names of pickled objects,Antoine Pitrou2009-05-021-1/+9
| | | | | saving memory and avoiding growth in size of subsequent pickles. Proposal and original patch by Jake McGuire.
* Issue #5835, deprecate PyOS_ascii_formatd.Eric Smith2009-04-251-1/+2
| | | | | | If anyone wants to clean up the documentation, feel free. It's my first documentation foray, and it's not that great. Will port to py3k with a different strategy.
* Issue #1672332: Fix unpickling of subnormal floats, which was raisingMark Dickinson2009-01-241-1/+2
| | | | | ValueError on some platforms as a result of the platform strtod setting errno on underflow.
* Issue #4051: Prevent conflict of UNICODE macros in cPickle.Martin v. Löwis2009-01-021-0/+8
|
* Fix issue #4730: cPickle corrupts high-unicode strings.Alexandre Vassalotti2008-12-271-30/+79
| | | | | Update outdated copy of PyUnicode_EncodeRawUnicodeEscape. Add a test case.
* Issue #4176: Pickle would crash the interpreter when a __reduce__ functionAmaury Forgeot d'Arc2008-10-301-26/+33
| | | | | | | | | does not return an iterator for the 4th and 5th items. (sequence-like and mapping-like state) A list is not an iterator... Will backport to 2.6 and 2.5.
* #3640: Correct a crash in cPickle on 64bit platforms, in the case of deeply ↵Amaury Forgeot d'Arc2008-09-111-64/+117
| | | | | | nested lists or dicts. Reviewed by Martin von Loewis.
* Fix #2702, with a correct accounting of recursion.Facundo Batista2008-06-301-10/+14
|
* Reverting the patch from #3165, as it broke otherFacundo Batista2008-06-251-4/+0
| | | | | | | | | behaviours. I left the original test commented out (note that that test came from #2702, which seems to have a problem in FreeBSD and Windows, but not in Linux). I included a new test, to watch over the now-broken behaviour, I took it from #3179.
* Fix compilation on Windows.Thomas Heller2008-06-231-2/+4
|
* Fixing the problem stated in issue 2702 with the patch submittedFacundo Batista2008-06-221-0/+2
| | | | | in the issue 3165. Now cPickle does not fails with uncontrolled behaviour when pickling into a very deep nested structure.
* Issue 3164. Small fix to don't repeat a comparationFacundo Batista2008-06-221-0/+2
| | | | without necessity.
* Merge in release25-maint r60793:Gregory P. Smith2008-06-111-0/+16
| | | | | | Added checks for integer overflows, contributed by Google. Some are only available if asserts are left in the code, in cases where they can't be triggered from Python code.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-64/+64
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-64/+64
|
* Revert copy_reg -> copyreg rename.Georg Brandl2008-05-201-7/+7
|
* Added Python 3.0 warning to cPickle.Alexandre Vassalotti2008-05-161-0/+6
|
* Added module stub for copy_reg renaming in 3.0.Alexandre Vassalotti2008-05-111-16/+16
| | | | | | Renamed copy_reg to copyreg in the standard library, to avoid spurious warnings and ease later merging to py3k branch. Public documentation remains intact.
* Use the new PyFile_IncUseCount & PyFile_DecUseCount calls appropriatlyGregory P. Smith2008-04-071-0/+4
| | | | | within the standard library. These modules use PyFile_AsFile and later release the GIL while operating on the previously returned FILE*.
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-11/+11
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* Fix Coverity #159.Neal Norwitz2007-10-051-1/+1
| | | | | | | This code was broken if save() returned a negative number since i contained a boolean value and then we compared i < 0 which should never be true. Will backport (assuming it's necessary)
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-16/+14
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Merge change 54909 from release25-maint: Fix several minor issues ↵Kristján Valur Jónsson2007-04-251-7/+12
| | | | discovered using code analysis in VisualStudio 2005 Team Edition
* Forward-port of r52136,52138: a review of overflow-detecting code.Armin Rigo2006-10-041-4/+8
| | | | | | | | | | | | | | | | | | | | | | | * unified the way intobject, longobject and mystrtoul handle values around -sys.maxint-1. * in general, trying to entierely avoid overflows in any computation involving signed ints or longs is extremely involved. Fixed a few simple cases where a compiler might be too clever (but that's all guesswork). * more overflow checks against bad data in marshal.c. * 2.5 specific: fixed a number of places that were still confusing int and Py_ssize_t. Some of them could potentially have caused "real-world" breakage. * list.pop(x): fixing overflow issues on x was messy. I just reverted to PyArg_ParseTuple("n"), which does the right thing. (An obscure test was trying to give a Decimal to list.pop()... doesn't make sense any more IMHO) * trying to write a few tests...
* Prevent memory leak on error.Neal Norwitz2006-08-021-1/+1
| | | | Reported by Klocwork #36
* Fix memory leaks spotted by Klocwork #37.Neal Norwitz2006-07-231-2/+2
|
* Fix more memory allocation issues found with failmalloc.Neal Norwitz2006-07-221-4/+9
|
* Fix bug #1512695: cPickle.loads could crash if it was interrupted withNeal Norwitz2006-06-281-2/+6
| | | | | | a KeyboardInterrupt since PyTuple_Pack was passed a NULL. Will backport.
* Make use of METH_O and METH_NOARGS where possible.Georg Brandl2006-05-291-22/+9
| | | | Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
* Conversion of exceptions over from faked-up classes to new-style C types.Richard Jones2006-05-271-2/+0
|
* Replace PyObject_CallFunction calls with only object argsGeorg Brandl2006-05-251-2/+2
| | | | with PyObject_CallFunctionObjArgs, which is 30% faster.
* Bug #1473625: stop cPickle making float dumps locale dependent in protocol 0.Georg Brandl2006-04-301-1/+3
| | | | | On the way, add a decorator to test_support to facilitate running single test functions in different locales with automatic cleanup.
* Use Py_VISIT in all tp_traverse methods, instead of traversing manually orThomas Wouters2006-04-151-34/+17
| | | | | | | | using a custom, nearly-identical macro. This probably changes how some of these functions are compiled, which may result in fractionally slower (or faster) execution. Considering the nature of traversal, visiting much of the address space in unpredictable patterns, I'd argue the code readability and maintainability is well worth it ;P
* Use Py_CLEAR instead of in-place DECREF/XDECREF or custom macros, forThomas Wouters2006-04-151-21/+17
| | | | tp_clear methods.
* Fix some warnings on HP-UX when using cc/aCCNeal Norwitz2006-04-101-2/+1
|
* Revert backwards-incompatible const changes.Martin v. Löwis2006-02-271-3/+3
|
* Merge ssize_t branch.Martin v. Löwis2006-02-151-26/+36
|
* Check return result from Py_InitModule*(). This API can fail.Neal Norwitz2006-01-191-0/+2
| | | | Probably should be backported.
* Add const to several API functions that take char *.Jeremy Hylton2005-12-101-10/+10
| | | | | | | | | | | | | | | | | | | In C++, it's an error to pass a string literal to a char* function without a const_cast(). Rather than require every C++ extension module to put a cast around string literals, fix the API to state the const-ness. I focused on parts of the API where people usually pass literals: PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type slots, etc. Predictably, there were a large set of functions that needed to be fixed as a result of these changes. The most pervasive change was to make the keyword args list passed to PyArg_ParseTupleAndKewords() to be a const char *kwlist[]. One cast was required as a result of the changes: A type object mallocs the memory for its tp_doc slot and later frees it. PyTypeObject says that tp_doc is const char *; but if the type was created by type_new(), we know it is safe to cast to char *.
* Eliminate the deprecated option to return None instead of a tuple of ↵Raymond Hettinger2004-12-071-11/+6
| | | | arguments in __reduce__().
* Patch #995766: Keyword argument support in cPickle.Martin v. Löwis2004-07-271-15/+21
|