summaryrefslogtreecommitdiffstats
path: root/Modules/cPickle.c
Commit message (Collapse)AuthorAgeFilesLines
* Enter Jim Fulton's latest version. He writes:Jeremy Hylton1998-08-131-20/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I had to make a slight diddle to work with Python 1.4, which we and some of our customers are still using. :( I've also made a few minor enhancements: - You can now both get and set the memo using a 'memo' attribute. This is handy for certain advanced applications that we have. - Added a 'binary' attribute to get and set the binary mode for a pickler. - Added a somewhat experimental 'fast' attribute. When this is set, objects are not placed in the memo during pickling. This should lead to faster pickling and smaller pickles in cases where: o you *know* there are no circular references, and o either you've: - preloaded the memo with class information by pickling classes in non-fast mode or by manipilating the memo directly, or - aren't pickling instances.
* Two fixes to find_class:Jeremy Hylton1998-08-111-9/+22
| | | | | | | | | | | | | | | 1. Only DECREF the class's module when the module is retrieved via PyImport_Import. If it is retrieved from the modules dictionary with PyDict_GetItem, it is using a borrowed reference. 2. If the module doesn't define the desired class, raise the same SystemError that pickle.py does instead of returning an AttributeError (which is cryptic at best). Also, fix the PyArg_ParseTuple in cpm_loads (the externally visible loads) function: Use "S" instead of "O" because cStringIO will croak with a "bad arguments to internal function" if passed anything other than a string.
* Jim Fulton's patches to get rid of the class_map().Guido van Rossum1998-08-081-73/+27
|
* Use PyErr_ExceptionMatches(...) instead of PyErr_Occurred() == ... in twoFred Drake1998-05-281-2/+4
| | | | places.
* whichmodule(): remove redundant PyErr_Clear(); add explicit settingGuido van Rossum1998-05-141-4/+3
| | | | of error when sys.modules isn't there.
* Use %.17f to format floats/doublesGuido van Rossum1998-04-031-1/+1
|
* Clear class_map in constructor so that when it later detects an errorGuido van Rossum1998-03-061-1/+2
| | | | and the destructor is called early, it doesn't DECREF garbage.
* Renamed Jim's PyErr_[JF]Format() to cPickle_ErrFormat(). It's not aGuido van Rossum1998-01-191-11/+10
| | | | standard Python API function so it should not have a Py prefix.
* Jim Fulton:Guido van Rossum1997-12-081-24/+50
| | | | | | | | | | | | | | | | | | | | | | - Loading non-binary string pickles checks for insecure strings. This is needed because cPickle (still) uses a restricted eval to parse non-binary string pickles. This change is needed to prevent untrusted pickles like:: "S'hello world'*2000000\012p0\012." from hosing an application. - User-defined types can now support unpickling without executing a constructor. The second value returned from __reduce__ can now be None, rather than an argument tuple. On unpickling, if the second value returned from __reduce__ during pickling was None, then rather than calling the first value returned from __reduce__, directly, the __basicnew__ method of the first value returned from __reduce__ is called without arguments.
* New versions of cPickle and cStringIO, from Jim Fulton's cPickle 1.0b1Guido van Rossum1997-12-041-246/+633
| | | | distribution.
* Initialize __version__ to the correct version string regardless ofGuido van Rossum1997-12-011-3/+14
| | | | | what RCS checkout options are used. Problem first diagnosed by Marc Lemburg.
* In whichmodule(), use __module__ if set.Guido van Rossum1997-09-281-0/+4
|
* #Plug small memory leaks in constructors.Guido van Rossum1997-09-031-2/+5
|
* Removed JF's dollar-Log-dollar RCS turd that caused compilation toBarry Warsaw1997-08-211-52/+0
| | | | | crash due to GvR's last check in message :-). Will try to convince JF to remove all this evilness.
* Added /**/ around #end tagsGuido van Rossum1997-08-211-1/+4
|
* Renamed strndup to pystrndup, to avoid conflicting prototypeGuido van Rossum1997-08-201-5/+9
| | | | in GNU libc on some platforms.
* cPickle release 0.3 from Jim FultonGuido van Rossum1997-08-131-49/+102
|
* Renamed strndup to my_strndup to avoid conflict witth GNU libc.Guido van Rossum1997-05-161-5/+8
|
* Use compile-time test for 64-bit hardware instead of run-time test.Guido van Rossum1997-05-131-1/+9
| | | | This silences some compilers.
* Instead of importing graminit.h whenever one of the three grammar 'root'Guido van Rossum1997-05-071-3/+6
| | | | symbols is needed, define these in Python.h with a Py_ prefix.
* Give PyErr_Format a new name and make it static.Guido van Rossum1997-04-091-0/+5
|
* Jim Fulton's version 2.2.Guido van Rossum1997-04-091-2810/+2931
|
* Eliminated gcc -Wall complaints:Barry Warsaw1997-01-141-26/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Quieted gcc -Wall by removing unused local variables. - Added some choice parentheses around assignments in conditional tests. - Removed an unused (and seemingly unreachable) err label in load_short_binstring(). - in Unpickler_load(), removed \. in string format. - init_stuff() was declared to return an int, but had these problems: - it was returning NULL instead of 0 or 1 in some cases - it was falling of the end of the routine without returning anything - the call of init_stuff() in initcPickle() was never checking the return value anyway. I changed all this by returning 1 in the case of errors, 0 when no error occurred. Then in initcPickle(), if init_stuff() returns non-zero, I call Py_FatalError(). Suppressing my urge to reformat according to Python coding standards! :-)
* cPickle, version 0.1.Guido van Rossum1997-01-061-0/+3767