You can use pickletools to identify the Protocol version. Have a look in the stdout which version was used. Probably Python2 is not able to unpickle dumps using protocol versions > 2.
import pickle
import pickletools
obj = {'load': pickle.load}
# dump all Python3 supported versions
for x in range(0, 6):
filename = '/tmp/data_v{x}.pickle'
with open(filename, 'wb') as f:
pickle.dump(obj, f, protocol=x)
with open(filename, 'rb') as f:
print(pickletools.dis(f))
Out for Python3 (truncated):
highest protocol among opcodes = 0
0: } EMPTY_DICT
1: q BINPUT 0
3: X BINUNICODE 'load'
12: q BINPUT 1
14: c GLOBAL 'pickle load'
27: q BINPUT 2
29: s SETITEM
30: . STOP
highest protocol among opcodes = 1
0: \x80 PROTO 2
2: } EMPTY_DICT
3: q BINPUT 0
5: X BINUNICODE 'load'
14: q BINPUT 1
16: c GLOBAL 'pickle load'
29: q BINPUT 2
31: s SETITEM
32: . STOP
highest protocol among opcodes = 2
0: \x80 PROTO 3
...