summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pickle.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-125631: Enable setting persistent_id and persistent_load of pickler and ↵Serhiy Storchaka2024-11-071-2/+80
| | | | | | | unpickler (GH-125752) pickle.Pickler.persistent_id and pickle.Unpickler.persistent_load can again be overridden as instance attributes.
* gh-126489: Do not call persistent_id() for a persistent id in Python pickle ↵Serhiy Storchaka2024-11-061-0/+6
| | | | (GH-126490)
* gh-122311: Add more tests for pickle (GH-122376)Serhiy Storchaka2024-07-281-0/+18
|
* gh-119521: Rename IncompleteInputError to _IncompleteInputError and remove ↵Pablo Galindo Salgado2024-06-241-1/+1
| | | | | | | from public API/ABI (GH-119680) Signed-off-by: Pablo Galindo <pablogsal@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-114570: Add PythonFinalizationError exception (#115352)Victor Stinner2024-02-141-0/+1
| | | | | | | | | | | | | | | | | Add PythonFinalizationError exception. This exception derived from RuntimeError is raised when an operation is blocked during the Python finalization. The following functions now raise PythonFinalizationError, instead of RuntimeError: * _thread.start_new_thread() * subprocess.Popen * os.fork() * os.fork1() * os.forkpty() Morever, _winapi.Overlapped finalizer now logs an unraisable PythonFinalizationError, instead of an unraisable RuntimeError.
* gh-113744: Add a new IncompleteInputError exception to improve incomplete ↵Pablo Galindo Salgado2024-01-301-1/+2
| | | | | input detection in the codeop module (#113745) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
* GH-114456: lower the recursion limit under WASI for debug builds (GH-114457)Brett Cannon2024-01-231-1/+3
| | | Testing under wasmtime 16.0.0 w/ code from https://github.com/python/cpython/issues/114413 is how the value was found.
* gh-89850: Add default C implementations of persistent_id() and ↵Serhiy Storchaka2024-01-101-3/+26
| | | | | | | | | | | persistent_load() (GH-113579) Previously the C implementation of pickle.Pickler and pickle.Unpickler classes did not have such methods and they could only be used if they were overloaded in subclasses or set as instance attributes. Fixed calling super().persistent_id() and super().persistent_load() in subclasses of the C implementation of pickle.Pickler and pickle.Unpickler classes. It no longer causes an infinite recursion.
* gh-103092: Isolate `_pickle` module (#102982)Erlend E. Aasland2023-04-041-0/+28
| | | | Co-authored-by: Mohamed Koubaa <koubaa.m@gmail.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* GH-84559: Deprecate fork being the multiprocessing default. (#100618)Gregory P. Smith2023-02-021-0/+2
| | | | | | | | This starts the process. Users who don't specify their own start method and use the default on platforms where it is 'fork' will see a DeprecationWarning upon multiprocessing.Pool() construction or upon multiprocessing.Process.start() or concurrent.futures.ProcessPool use. See the related issue and documentation within this change for details.
* GH-89988: Fix memory leak in pickle.Pickler dispatch_table lookup (GH-94298)Kumar Aditya2022-06-281-0/+23
|
* bpo-45292: [PEP 654] add the ExceptionGroup and BaseExceptionGroup classes ↵Irit Katriel2021-10-221-1/+3
| | | | (GH-28569)
* bpo-45229: Make pickle tests discoverable (GH-28467)Serhiy Storchaka2021-09-201-32/+21
|
* bpo-44785: Silence deprecation warnings in test_pickle (#27538)Serhiy Storchaka2021-08-021-1/+5
|
* bpo-43510: Implement PEP 597 opt-in EncodingWarning. (GH-19481)Inada Naoki2021-03-291-1/+2
| | | | | | | | | | | See [PEP 597](https://www.python.org/dev/peps/pep-0597/). * Add `-X warn_default_encoding` and `PYTHONWARNDEFAULTENCODING`. * Add EncodingWarning * Add io.text_encoding() * open(), TextIOWrapper() emits EncodingWarning when encoding is omitted and warn_default_encoding is enabled. * _pyio.TextIOWrapper() uses UTF-8 as fallback default encoding used when failed to import locale module. (used during building Python) * bz2, configparser, gzip, lzma, pathlib, tempfile modules use io.text_encoding(). * What's new entry
* bpo-40275: Use new test.support helper submodules in tests (GH-21314)Hai Shi2020-07-061-1/+2
|
* bpo-37210: Fix pure Python pickle when _pickle is unavailable (GH-14016)Victor Stinner2019-06-131-6/+7
| | | | | | | Allow pure Python implementation of pickle to work even when the C _pickle module is unavailable. Fix test_pickle when _pickle is missing: declare PyPicklerHookTests outside "if has_c_implementation:" block.
* bpo-36785: PEP 574 implementation (GH-7076)Antoine Pitrou2019-05-261-6/+6
|
* bpo-35900: Enable custom reduction callback registration in _pickle (GH-12499)Pierre Glaser2019-05-081-2/+16
| | | | Enable custom reduction callback registration for functions and classes in _pickle.c, using the new Pickler's attribute ``reducer_override``.
* Fix upsizing of marks stack in pickle module. (GH-8860)Sergey Fedoseev2018-08-251-3/+3
| | | Previously marks stack was upsized even there was space for additional item.
* bpo-31993: Do not create frames for large bytes and str objects (#5114)Serhiy Storchaka2018-01-111-2/+2
| | | | | | | when serialize into memory buffer with C pickle implementations. This optimization already is performed when serialize into memory with Python pickle implementations or into a file with both implementations.
* bpo-28416: Break reference cycles in Pickler and Unpickler subclasses (#4080)Serhiy Storchaka2017-11-301-2/+63
| | | | with the persistent_id() and persistent_load() methods.
* bpo-32032: Test both implementations of module-level pickle API. (#4401)Serhiy Storchaka2017-11-151-4/+12
|
* Issue #15767: Add ModuleNotFoundError.Eric Snow2016-09-071-0/+8
|
* Issue #25761: Improved error reporting about truncated pickle data inSerhiy Storchaka2016-09-061-2/+1
| | | | | C implementation of unpickler. UnpicklingError is now raised instead of AttributeError and ValueError in some cases.
* Issue #17711: Fixed unpickling by the persistent ID with protocol 0.Serhiy Storchaka2016-07-171-8/+25
|\ | | | | | | Original patch by Alexandre Vassalotti.
| * Issue #17711: Fixed unpickling by the persistent ID with protocol 0.Serhiy Storchaka2016-07-171-8/+25
| | | | | | | | Original patch by Alexandre Vassalotti.
* | Added exceptins for testing non-reversible import mapping for Issue #26013.Serhiy Storchaka2016-01-181-0/+2
|\ \ | |/
| * Added exceptins for testing non-reversible import mapping for Issue #26013.Serhiy Storchaka2016-01-181-0/+2
| |
* | Issue #25761: Improved detecting errors in broken pickle data.Serhiy Storchaka2015-12-061-5/+0
|/
* Issue #25761: Added more test cases for testing unpickling broken data.Serhiy Storchaka2015-11-291-0/+13
|\ | | | | | | Output raised exception at verbose level 2 (-vv).
| * Issue #25761: Added more test cases for testing unpickling broken data.Serhiy Storchaka2015-11-291-0/+13
| | | | | | | | Output raised exception at verbose level 2 (-vv).
* | Issue #23914: Fixed SystemError raised by unpickler on broken pickle data.Serhiy Storchaka2015-11-231-0/+3
|\ \ | |/
| * Issue #23914: Fixed SystemError raised by unpickler on broken pickle data.Serhiy Storchaka2015-11-231-0/+3
| |
* | Issue #25365: test_pickle now works in threads disabled builds.Serhiy Storchaka2015-10-101-2/+3
|\ \ | |/
| * Issue #25365: test_pickle now works in threads disabled builds.Serhiy Storchaka2015-10-101-2/+3
| |
* | Moved unpickling tests with prepickled data to separate class.Serhiy Storchaka2015-09-291-3/+18
|\ \ | |/
| * Moved unpickling tests with prepickled data to separate class.Serhiy Storchaka2015-09-291-3/+18
| |
* | Issue #19235: Add new RecursionError exception. Patch by Georg Brandl.Yury Selivanov2015-07-031-1/+2
| |
* | PEP 0492 -- Coroutines with async and await syntax. Issue #24017.Yury Selivanov2015-05-121-1/+3
|/
* Issue #18473: Fixed pickle compatibility tests for optional modules.Serhiy Storchaka2015-03-311-10/+25
| | | | Added WindowsError to compatibility mappings.
* Issue #18473: Fixed 2to3 and 3to2 compatible pickle mappings.Serhiy Storchaka2015-03-311-1/+151
| | | | | | | | Fixed ambigious reverse mappings. Added many new mappings. Import mapping is no longer applied to modules already mapped with full name mapping. Added tests for compatible pickling and unpickling and for consistency of _compat_pickle mappings.
* Issue #15513: Added a __sizeof__ implementation for pickle classes.Serhiy Storchaka2014-12-161-1/+69
|
* Issue #6784: Strings from Python 2 can now be unpickled as bytes objects.Alexandre Vassalotti2013-12-071-0/+4
| | | | | | | Initial patch by Merlijn van Deen. I've added a few unrelated docstring fixes in the patch while I was at it, which makes the documentation for pickle a bit more consistent.
* Issue #18339: use with self.assertRaises() to make test case more readableChristian Heimes2013-07-011-2/+4
|
* Issue #18339: Negative ints keys in unpickler.memo dict no longer cause aChristian Heimes2013-07-011-0/+7
| | | | segfault inside the _pickle C extension.
* Issue #14166: Pickler objects now have an optional `dispatch_table` ↵Antoine Pitrou2012-03-041-1/+27
| | | | | | attribute which allows to set custom per-pickler reduction functions. Patch by sbt.
* Issue #11564: Avoid crashes when trying to pickle huge objects or containersAntoine Pitrou2011-08-291-3/+4
| | | | (more than 2**31 items). Instead, in most cases, an OverflowError is raised.
* Merged revisions 88546 via svnmerge fromAlexander Belopolsky2011-02-241-6/+6
| | | | | | | | | | 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. ........
* Issue #9410: Various optimizations to the pickle module, leading toAntoine Pitrou2010-09-091-1/+14
| | | | | speedups up to 4x (depending on the benchmark). Mostly ported from Unladen Swallow; initial patch by Alexandre Vassalotti.