New submission from Nicholas Neumann <nick2...@gmail.com>:

The docs for pickle, in python 2, say that the default pickle protocol, 0, 
produces ASCII. In the python 3 docs, this has changed to "human-readable". 
While the pickle output with protocol 0 loads fine in python2, it is definitely 
not human-readable, as it is not valid ASCII and contains every possible byte.

To see a simple example, run this in both python 2 and 3

import pickle
a = bytearray(range(255)) #bytes containing 0..255
b = bytes(a)
c = pickle.dumps(b,protocol=0)
print(c)#human readable in 2, not in 3
c.decode('ascii')#throws in 3, not in 2

----------
messages: 352907
nosy: aggieNick02
priority: normal
severity: normal
status: open
title: Pickle with protocol=0 in python 3 does not produce a 'human-readable' 
format
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38241>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to