| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Florent Xicluna.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Will backport to 2.6, 3.x already fixed a similar issue with issue4298.
|
| |
|
| |
|
|
|
|
|
| |
saving memory and avoiding growth in size of subsequent pickles. Proposal
and original patch by Jake McGuire.
|
|
|
|
|
|
|
|
|
|
|
| |
- Add tests for the module-level load() and dump() functions.
- Add tests for cPickle's internal data structures, stressing workloads
with many gets/puts.
- Add tests for the Pickler and Unpickler classes, in particular the
memo attribute.
- test_xpickle is extended to test backwards compatibility with Python
2.4, 2.5 and 2.6 by round-tripping pickled objects through a worker
process. This is guarded with a regrtest -u xpickle resource.
|
|
|
|
|
| |
ValueError on some platforms as a result of the platform strtod setting
errno on underflow.
|
| |
|
|
|
|
|
| |
Update outdated copy of PyUnicode_EncodeRawUnicodeEscape.
Add a test case.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
Renamed copy_reg to copyreg in the standard library, to avoid
spurious warnings and ease later merging to py3k branch. Public
documentation remains intact.
|
|
|
|
|
| |
the implementation for __reduce__ and __reduce_ex__ into two separate
functions. Fixes bug #931877. Will backport.
|
|
|
|
|
| |
On the way, add a decorator to test_support to facilitate running single
test functions in different locales with automatic cleanup.
|
| |
|
|
|
|
|
| |
SF patch 825639
http://mail.python.org/pipermail/python-dev/2003-October/039445.html
|
| |
|
|
|
|
| |
proto 2 pickle too.
|
|
|
|
| |
checks in his changes to support this in cPickle.c.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the optional proto 2 slot state.
pickle.py, load_build(): CAUTION: Noted that cPickle's
load_build and pickle's load_build really don't do the same
things with the state, and didn't before this patch either.
cPickle never tries to do .update(), and has no backoff if
instance.__dict__ can't be retrieved. There are no tests
that can tell the difference, and part of what cPickle's
load_build() did looked accidental to me, so I don't know
what the true intent is here.
pickletester.py, test_pickle.py: Got rid of the hack for
exempting cPickle from running some of the proto 2 tests.
dictobject.c, PyDict_Next(): documented intended use.
|
|
|
|
| |
how to unpickle the new slot-full state tuples.
|
|
|
|
|
|
|
| |
and loading them via the other, except for the special cases of this
Guido added to test_datetime.py for datetime module objects. The new
test_xpickle.py tries all of pickletester's AbstractPickleTests in
both x-module ways.
|
|
|
|
| |
test for now (cPickle can't yet produce NEWOBJ).
|
| |
|
|
|
|
|
| |
attempts to merge the C list-batch and dict-batch code -- they worked, but
it was a godawful mess to read.
|
| |
|
|
|
|
|
|
| |
getting done. Since this isn't yet implemented in cPickle, the
new tests are in TempAbstractPickleTests (which cPickle doesn't
run).
|
|
|
|
|
|
|
|
|
|
|
|
| |
guarantee to keep valid pointers in its slots.
tests: Moved ExtensionSaver from test_copy_reg into pickletester, and
use it both places. Once extension codes get assigned, it won't be
safe to overwrite them willy nilly in test suites, and ExtensionSaver
does a thorough job of undoing any possible damage.
Beefed up the EXT[124] tests a bit, to check the smallest and largest
codes in each opcode's range too.
|
|
|
|
|
| |
Moved such EXT tests as currently exist from TempAbstractPickleTests to
AbstractPickleTests, so that test_cpickle runs them too.
|
|
|
|
| |
all protocols, so tried them under all.
|
|
|
|
| |
hardcoded list.
|
|
|
|
| |
duplication. Note that these still don't get run under cPickle.
|
|
|
|
| |
earlier than the ones in which they were introduced.
|
|
|
|
|
|
| |
are actually getting generated. Add helpered method
ensure_opcode_in_pickle to do a correct job checking for that. Changed
test_long1(), test_long4(), and test_short_tuples() to use it.
|
|
|
|
| |
overflow holes in Pdata_grow().
|
| |
|
|
|
|
|
|
|
| |
loops. Renamed DATA and BINDATA to DATA0 and DATA1. Included
disassemblies, but noted why we can't test them. Added XXX comment to
cPickle about a mysterious comment, where pickle and cPickle diverge
in how they number PUT indices.
|
|
|
|
|
| |
the hitherto unknown (to me) noload() cPickle function, which is (a)
something we don't test at all, and (b) pickle.py doesn't have.
|
|
|
|
|
| |
power of 2. Enabled the tail end of test_long() in pickletester.py
because it no longer takes forever when run from test_pickle.py.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Assorted code cleanups; e.g., sizeof(char) is 1 by definition, so there's
no need to do things like multiply by sizeof(char) in hairy malloc
arguments. Fixed an undetected-overflow bug in readline_file().
longobject.c: Fixed a really stupid bug in the new _PyLong_NumBits.
pickle.py: Fixed stupid bug in save_long(): When proto is 2, it
wrote LONG1 or LONG4, but forgot to return then -- it went on to
append the proto 1 LONG opcode too.
Fixed equally stupid cancelling bugs in load_long1() and
load_long4(): they *returned* the unpickled long instead of pushing
it on the stack. The return values were ignored. Tests passed
before only because save_long() pickled the long twice.
Fixed bugs in encode_long().
Noted that decode_long() is quadratic-time despite our hopes,
because long(string, 16) is still quadratic-time in len(string).
It's hex() that's linear-time. I don't know a way to make decode_long()
linear-time in Python, short of maybe transforming the 256's-complement
bytes into marshal's funky internal format, and letting marshal decode
that. It would be more valuable to make long(string, 16) linear time.
pickletester.py: Added a global "protocols" vector so tests can try
all the protocols in a sane way. Changed test_ints() and test_unicode()
to do so. Added a new test_long(), but the tail end of it is disabled
because it "takes forever" under pickle.py (but runs very quickly under
cPickle: cPickle proto 2 for longs is linear-time).
|
|
|
|
| |
attr, and copy_reg.safe_constructors.
|
|
|
|
|
|
|
|
| |
types. The special handling for these can now be removed from save_newobj().
Add some testing for this.
Also add support for setting the 'fast' flag on the Python Pickler class,
which suppresses use of the memo.
|
|
|
|
| |
TempAbstractPickleTests, because they don't work with cPickle yet.
|
|
|
|
|
|
| |
only get run by test_pickle.py now (& not by test_cpickle.py). This
should be undone when protocol 2 is implemented in cPickle too.
test_cpickle should pass again.
|
| |
|
|
|
|
|
|
| |
possibility of calling save_reduce(). Add a special hack for this.
The tests for this are much simpler now (no __getstate__ or
__getnewargs__ needed).
|
|
|
|
| |
fixed a bug in load_newobj().
|
|
|
|
| |
NEWFALSE and NEWTRUE.
|