Skip to content

use highest protocol version for pickling - #17

Merged
ionrock merged 4 commits into
psf:masterfrom
farwayer:pickle_protocol
Mar 25, 2014
Merged

ionrock merged 4 commits into
psf:masterfrom
farwayer:pickle_protocol

Conversation

@farwayer

Copy link
Copy Markdown
Contributor

This is a very rare situation, when used old cache data from one environment to another with lower python version. I think it makes no sense to use the old ASCII protocol.

@ionrock

ionrock commented Mar 25, 2014

Copy link
Copy Markdown
Contributor

@farwayer I actually looked at this an explicitly chose not to use the latest. The reason being is that I wanted to avoid the situation where you had a cache and the pickle format is updated (maybe a python version bump?) and you ruin your cache.

This might have been paranoia on my part. Do you mind letting me know your thoughts on upgrades causing cache corruption? I bet it is really easy to sway me on this ;)

Thanks for looking into it!

@farwayer

Copy link
Copy Markdown
Contributor Author

I will try :)
All pickle protocols are forward compatible. That mean more new python version support old pickle protocols. So we only can get problem with downgrading python and than using old cache. This isn't very often situation imho. However thanks for describing this use case. I added checking it.

I also found encoding bug with unpickling py2 pickled cache in py3.

ionrock added a commit that referenced this pull request Mar 25, 2014
use highest protocol version for pickling
@ionrock
ionrock merged commit f1159d2 into psf:master Mar 25, 2014
@ionrock

ionrock commented Mar 25, 2014

Copy link
Copy Markdown
Contributor

Fantastic. Thank you @farwayer!

@farwayer
farwayer deleted the pickle_protocol branch March 25, 2014 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants