[2.7] bpo-31829: Resolve some portability issues with pickle. by serhiy-storchaka · Pull Request #4067 · python/cpython
serhiy-storchaka
changed the title
bpo-31314: Resolve some portability issues with pickle.
bpo-31829: Resolve some portability issues with pickle.
serhiy-storchaka
changed the title
bpo-31829: Resolve some portability issues with pickle.
[2.7] bpo-31829: Resolve some portability issues with pickle.
* Document that files should be open in binary mode even for protocol 0 for portability. * Raise a ValueError when pickle with binary protocol to a file opened in text mode on Windows. * Emit a deprecation warning when pickle with binary protocol to a file opened in text mode on Unix. * Emit a deprecation warning in Py3k mode when pickle with protocol 0 to a file opened in text mode. * Fixed unpickling on Unix or in binary mode files writen in text mode on Windows. RuntimeWarning now is emitted in cases that was not unpickleable before. Files containing Unicode strings will be unpickled incorrectly. * `\r`, `\0` and `\x1a` (end-of-file on Windows) now are escaped in Unicode strings in protocol 0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters