google / novm

Experimental KVM-based VMM for containers, written in Go.
Apache License 2.0
1.68k stars 123 forks source link

Force pickle.dump uses protocol 2 #31

Closed hamo closed 9 years ago

hamo commented 9 years ago

with python2, pickle.dump use protocol 0 if not specified, protocol 0 is an ASCII protocol, current code works. with python3, pickle.dump use protocol 3 if not specified, protocol 3 is a binary protocol, it requires the file to be written to is opened with "b", so python3 will complain that w is not opened with "b".

For better compatibility, force pickle.dump uses protocol 2, which is a binary protocol and open the pipe with "b", which will give us better performance.

Review on Reviewable