[New-bugs-announce] [issue38241] Pickle with protocol=0 in python 3 does not produce a 'human-readable' format

Nicholas Neumann report at bugs.python.org
Fri Sep 20 18:53:12 EDT 2019


New submission from Nicholas Neumann <nick2002 at 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 <report at bugs.python.org>
<https://bugs.python.org/issue38241>
_______________________________________


More information about the New-bugs-announce mailing list