On the UsingPickle article on Python Wiki it suggests using TrustedPickle in order to give more protection to Pickle files through looking for authorised signatures and keys.
I downloaded TrustedPickle 0.01 and installed it as instructed by putting the TrustedPickle.py script iin C:\Python33\Lib\site-packages.
However, following the steps in order to use TrustedPickle, the module doesn't work.
I've opened the script and tried running it and it comes up with invalid syntax and it pointing to Line 142 and Column 22. Can someone look at the script and see what's wrong? This script is too far out of my depth to solve myself.
You can download the script here: http://sourceforge.net/projects/trustedpickle/files/trustedpickle/0.01/
I've tried 0.02 and that doesn't work either.
The line in question is:
The trailing
L
(for "long") is invalid syntax in Python 3; it is unnecessary, as Python 3'sint
now covers bothint
andlong
from Python 2.x.In short, it appears that the library does not support Python 3.x. The following modifications to
trusted_pickle.py
:L
s from numbers;import sets
and replace allsets.Set(
withset(
;long(
withint(
;import md5
withimport hashlib
and replacemd5.md5(String)
withhashlib.md5(String.encode())
; andraw_input(
withinput(
;allow the library to
import
in Python 3.x. However, I have not tested that it actually works with these changes.