Commit Graph

134 Commits

Author SHA1 Message Date
Antoine Pitrou 9facaf4f65 Issue #15079: make a test applicable to both C and Python versions of the pickle module.
Patch by Stefan Mihaila.
2012-06-26 23:05:27 +02:00
Antoine Pitrou 79035bd71f Issue #15079: make a test applicable to both C and Python versions of the pickle module.
Patch by Stefan Mihaila.
2012-06-26 23:04:48 +02:00
Łukasz Langa f3078fbee2 Fixes #13842: cannot pickle Ellipsis or NotImplemented.
Thanks for James Sanders for the bug report and the patch.
2012-03-12 19:46:12 +01:00
Antoine Pitrou 8d3c290de4 Issue #14166: Pickler objects now have an optional `dispatch_table` attribute which allows to set custom per-pickler reduction functions.
Patch by sbt.
2012-03-04 18:31:48 +01:00
Alexandre Vassalotti a23d65ccfe Merge 3.2 2011-12-13 13:22:42 -05:00
Alexandre Vassalotti 3bfc65a25b Issue #13505: Make pickling of bytes object compatible with Python 2.
Initial patch by sbt.
2011-12-13 13:08:09 -05:00
Antoine Pitrou b7591d4780 Also fix pickletester 2011-10-04 16:18:15 +02:00
Antoine Pitrou 1a3ff48c55 Start fixing test_bigmem:
- bigmemtest is replaced by precisionbigmemtest
- add a poor man's watchdog thread to print memory consumption
2011-10-04 10:28:37 +02:00
Antoine Pitrou 94190bb6e7 Start fixing test_bigmem:
- bigmemtest is replaced by precisionbigmemtest
- add a poor man's watchdog thread to print memory consumption
2011-10-04 10:22:36 +02:00
Antoine Pitrou 5a688dbf97 Issue #7689: Allow pickling of dynamically created classes when their
metaclass is registered with copyreg.  Patch by Nicolas M. Thiéry and
Craig Citro.
2011-10-04 09:25:28 +02:00
Antoine Pitrou ffd41d9f10 Issue #7689: Allow pickling of dynamically created classes when their
metaclass is registered with copyreg.  Patch by Nicolas M. Thiéry and
Craig Citro.
2011-10-04 09:23:04 +02:00
Antoine Pitrou 2d243494c6 Try to fix one of the bigmem tests in test_pickle 2011-08-30 23:39:59 +02:00
Antoine Pitrou e897e95880 Try to fix one of the bigmem tests in test_pickle 2011-08-30 23:39:34 +02:00
Antoine Pitrou a514eb95f3 Issue #12847: Fix a crash with negative PUT and LONG_BINPUT arguments in
the C pickle implementation.
2011-08-30 00:28:40 +02:00
Antoine Pitrou 55549ec476 Issue #12847: Fix a crash with negative PUT and LONG_BINPUT arguments in
the C pickle implementation.
2011-08-30 00:27:10 +02:00
Antoine Pitrou ee763e2acc Issue #11564: Avoid crashes when trying to pickle huge objects or containers
(more than 2**31 items).  Instead, in most cases, an OverflowError is raised.
2011-08-29 23:14:53 +02:00
Antoine Pitrou 82be19f889 Issue #11564: Avoid crashes when trying to pickle huge objects or containers
(more than 2**31 items).  Instead, in most cases, an OverflowError is raised.
2011-08-29 23:09:33 +02:00
Antoine Pitrou 85674936c7 Monotonic, not monotonous 2011-08-14 01:51:52 +02:00
Antoine Pitrou 3c7e928098 Issue #12744: Fix inefficient representation of integers
between 2**31 and 2**63 on systems with a 64-bit C "long".
2011-08-13 20:15:19 +02:00
Antoine Pitrou fdf4a27422 Issue #12687: Fix a possible buffering bug when unpickling text mode (protocol 0, mostly) pickles. 2011-08-11 21:15:53 +02:00
Antoine Pitrou f6c7a8595e Issue #12687: Fix a possible buffering bug when unpickling text mode (protocol 0, mostly) pickles. 2011-08-11 21:04:02 +02:00
Antoine Pitrou 16c4ce1903 Issue #9935: Speed up pickling of instances of user-defined classes. 2011-03-11 21:30:43 +01:00
Alexander Belopolsky ec8f0df229 Merged revisions 88546 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r88546 | alexander.belopolsky | 2011-02-24 14:40:09 -0500 (Thu, 24 Feb 2011) | 3 lines

  Issue #11286: Fixed unpickling of empty 2.x strings.
........
2011-02-24 20:34:38 +00:00
Alexander Belopolsky 1ce92dc20d Issue #11286: Fixed unpickling of empty 2.x strings. 2011-02-24 19:40:09 +00:00
Brett Cannon 31f5929c1e Issue #10990: Prevent tests from clobbering a set trace function.
Many tests simply didn't care if they unset a pre-existing trace function. This
made test coverage impossible. This patch fixes various tests to put back any
pre-existing trace function. It also introduces test.support.no_tracing as a
decorator which will temporarily unset the trace function for tests which
simply fail otherwise.

Thanks to Kristian Vlaardingerbroek for helping to find the cause of various
trace function unsets.
2011-02-21 19:29:56 +00:00
Ezio Melotti b3aedd4862 #9424: Replace deprecated assert* methods in the Python test suite. 2010-11-20 19:04:17 +00:00
Antoine Pitrou ff150f2921 Revert r85797 (and r85798): it broke the Windows buildbots because of
test_multiprocessing's misbehaviour.
2010-10-22 21:41:05 +00:00
Antoine Pitrou 7eecffd05d Issue #9935: Speed up pickling of instances of user-defined classes. 2010-10-22 19:43:59 +00:00
Antoine Pitrou 04248a8d99 Issue #3873: Speed up unpickling from file objects which have a peek()
method.
2010-10-12 20:51:21 +00:00
Antoine Pitrou ea99c5c949 Issue #9410: Various optimizations to the pickle module, leading to
speedups up to 4x (depending on the benchmark).  Mostly ported from
Unladen Swallow; initial patch by Alexandre Vassalotti.
2010-09-09 18:33:21 +00:00
Alexander Belopolsky d92f04062a Issue #5180: Fixed a bug that prevented loading 2.x pickles in 3.x
python when they contain instances of old-style classes.
2010-07-17 22:50:45 +00:00
Victor Stinner 485fb56eb8 Issue #8383: pickle and pickletools use surrogatepass error handler when
encoding unicode as utf8 to support lone surrogates and stay compatible with
Python 2.x and 3.0
2010-04-13 11:07:24 +00:00
Ezio Melotti e96159335f Merged revisions 77727 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77727 | ezio.melotti | 2010-01-24 18:58:36 +0200 (Sun, 24 Jan 2010) | 1 line

  use assert[Not]IsInstance where appropriate
........
2010-01-24 19:26:24 +00:00
Ezio Melotti b58e0bd8bb use assert[Not]In where appropriate 2010-01-23 15:40:09 +00:00
Antoine Pitrou 01a15ea2b6 Merged revisions 77352-77354 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77352 | antoine.pitrou | 2010-01-07 18:46:49 +0100 (jeu., 07 janv. 2010) | 5 lines

  Issue #7455: Fix possible crash in cPickle on invalid input.  Patch by
  Florent Xicluna.
........
  r77353 | antoine.pitrou | 2010-01-07 18:49:37 +0100 (jeu., 07 janv. 2010) | 3 lines

  Fix attribution. Florent actually repackaged and reviewed Victor's patch (sorry!).
........
  r77354 | antoine.pitrou | 2010-01-07 18:54:10 +0100 (jeu., 07 janv. 2010) | 3 lines

  Fix reattribution mistake when fixing attribution mistake!
........
2010-01-07 17:57:31 +00:00
Mark Dickinson 5c2db37c20 Issue #7435: Remove duplicate int/long tests, and other
references to long in py3k.  Patch provided by flox.
2009-12-05 20:28:34 +00:00
Benjamin Peterson c9c0f201fe convert old fail* assertions to assert* 2009-06-30 23:06:06 +00:00
Antoine Pitrou d9dfaa9487 Issue #6137: The pickle module now translates module names when loading
or dumping pickles with a 2.x-compatible protocol, in order to make data
sharing and migration easier. This behaviour can be disabled using the
new `fix_imports` optional argument.
2009-06-04 20:32:06 +00:00
Collin Winter 8ca69de237 Merged revisions 72930 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72930 | collin.winter | 2009-05-25 21:12:39 -0700 (Mon, 25 May 2009) | 1 line

  Issue 5794: fix cPickle's unpickling of recursive tuples.
........
2009-05-26 16:53:41 +00:00
Antoine Pitrou a9f48a0d4f Merged revisions 72223 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72223 | antoine.pitrou | 2009-05-02 23:13:23 +0200 (sam., 02 mai 2009) | 5 lines

  Isue #5084: unpickling now interns the attribute names of pickled objects,
  saving memory and avoiding growth in size of subsequent pickles. Proposal
  and original patch by Jake McGuire.
........
2009-05-02 21:41:14 +00:00
Collin Winter 771d8341cd Port r71408 to py3k: issue 5665, add more pickling tests. 2009-04-16 03:18:06 +00:00
Mark Dickinson cddcf444b2 Merged revisions 68903,68906 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68903 | mark.dickinson | 2009-01-24 16:40:29 +0000 (Sat, 24 Jan 2009) | 5 lines

  Issue #1672332: Fix unpickling of subnormal floats, which was raising
  ValueError on some platforms as a result of the platform strtod setting
  errno on underflow.
........
  r68906 | mark.dickinson | 2009-01-24 21:08:38 +0000 (Sat, 24 Jan 2009) | 2 lines

  Issue #3657: fix occasional test_pickletools failures.
........
2009-01-24 21:46:33 +00:00
Mark Dickinson 8dd05147d6 Issue #4842, patch 1/2: fix pickle in Python 3.x so that pickling with the
'L' opcode always appends an 'L' on output, just as 2.x does.  When
unpickling, remove the trailing 'L' (if present) before passing the
result to PyLong_FromString.
2009-01-20 20:43:58 +00:00
Benjamin Peterson d148630e72 fix syntax 2008-12-27 16:58:50 +00:00
Benjamin Peterson 9203501bae Merged revisions 67889-67892,67895,67898,67904-67907,67912,67918,67920-67921,67923-67924,67926-67927,67930,67943 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

................
  r67889 | benjamin.peterson | 2008-12-20 19:04:32 -0600 (Sat, 20 Dec 2008) | 1 line

  sphinx.web is long gone
................
  r67890 | benjamin.peterson | 2008-12-20 19:12:26 -0600 (Sat, 20 Dec 2008) | 1 line

  update readme
................
  r67891 | benjamin.peterson | 2008-12-20 19:14:47 -0600 (Sat, 20 Dec 2008) | 1 line

  there are way too many places which need to have the current version added
................
  r67892 | benjamin.peterson | 2008-12-20 19:29:32 -0600 (Sat, 20 Dec 2008) | 9 lines

  Merged revisions 67809 via svnmerge from
  svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

  ........
    r67809 | benjamin.peterson | 2008-12-15 21:54:45 -0600 (Mon, 15 Dec 2008) | 1 line

    fix logic error
  ........
................
  r67895 | neal.norwitz | 2008-12-21 08:28:32 -0600 (Sun, 21 Dec 2008) | 2 lines

  Add Tarek for work on distutils.
................
  r67898 | benjamin.peterson | 2008-12-21 15:00:53 -0600 (Sun, 21 Dec 2008) | 1 line

  compute DISTVERSION with patchlevel.py
................
  r67904 | benjamin.peterson | 2008-12-22 14:44:58 -0600 (Mon, 22 Dec 2008) | 1 line

  less attitude
................
  r67905 | benjamin.peterson | 2008-12-22 14:51:15 -0600 (Mon, 22 Dec 2008) | 1 line

  fix #4720: the format to PyArg_ParseTupleAndKeywords can now start with '|'
................
  r67906 | benjamin.peterson | 2008-12-22 14:52:53 -0600 (Mon, 22 Dec 2008) | 1 line

  add NEWS note
................
  r67907 | benjamin.peterson | 2008-12-22 16:12:19 -0600 (Mon, 22 Dec 2008) | 1 line

  silence compiler warning
................
  r67912 | georg.brandl | 2008-12-23 06:37:21 -0600 (Tue, 23 Dec 2008) | 2 lines

  Fix missing "svn" command.
................
  r67918 | georg.brandl | 2008-12-23 09:44:25 -0600 (Tue, 23 Dec 2008) | 2 lines

  Markup fix.
................
  r67920 | benjamin.peterson | 2008-12-23 14:09:28 -0600 (Tue, 23 Dec 2008) | 1 line

  use a global variable, so the compiler doesn't optimize the assignment out
................
  r67921 | benjamin.peterson | 2008-12-23 14:12:33 -0600 (Tue, 23 Dec 2008) | 1 line

  make global static
................
  r67923 | benjamin.peterson | 2008-12-24 09:10:27 -0600 (Wed, 24 Dec 2008) | 1 line

  #4736 BufferRWPair.closed shouldn't try to call another property as a function
................
  r67924 | benjamin.peterson | 2008-12-24 10:10:05 -0600 (Wed, 24 Dec 2008) | 1 line

  pretend exceptions don't exist a while longer
................
  r67926 | tarek.ziade | 2008-12-24 13:10:05 -0600 (Wed, 24 Dec 2008) | 1 line

  fixed #4400 : distutils .pypirc default generated file was broken.
................
  r67927 | benjamin.peterson | 2008-12-26 17:26:30 -0600 (Fri, 26 Dec 2008) | 1 line

  python version is included in file name now
................
  r67930 | hirokazu.yamamoto | 2008-12-26 22:19:48 -0600 (Fri, 26 Dec 2008) | 2 lines

  Issue #4740: Use HIGHEST_PROTOCOL in pickle test.
  (There is no behavior difference in 2.x because HIGHEST_PROTOCOL == 2)
................
  r67943 | alexandre.vassalotti | 2008-12-27 04:02:59 -0600 (Sat, 27 Dec 2008) | 2 lines

  Fix bogus unicode tests in pickletester.
................
2008-12-27 16:00:54 +00:00
Alexandre Vassalotti 554d878b1c Update copy of PyUnicode_EncodeRawUnicodeEscape in _pickle.
Add astral character test case.
2008-12-27 07:32:41 +00:00
Amaury Forgeot d'Arc 3e4e72f66f #4298: pickle.load() can segfault on invalid or truncated input.
Patch and test by Hirokazu Yamamoto.
2008-11-11 20:05:06 +00:00
Amaury Forgeot d'Arc 6285ffd9db Correct the pickle test, broken since r67059:
the python version of pickle is still more tolerant than the C one.
2008-10-31 17:52:47 +00:00
Amaury Forgeot d'Arc 424b4819be Merged revisions 67049 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r67049 | amaury.forgeotdarc | 2008-10-30 22:18:34 +0100 (jeu., 30 oct. 2008) | 8 lines

  Issue #4176: Pickle would crash the interpreter when a __reduce__ function
  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.
........
2008-10-30 22:25:31 +00:00
Amaury Forgeot d'Arc 87eee631fb #3664: The pickle module could segfault if a Pickler instance is not correctly initialized:
when a subclass forgets to call the base __init__ method,
or when __init__ is called a second time with invalid parameters

Patch by Alexandre Vassalotti.
2008-10-17 20:15:53 +00:00