Hi *jo*,
*jo* wrote:
> I'm having trouble unpickling a value from cherrypy.session -- it
gives me *a ValueError:* *insecure* *string* *pickle*.
> ...
> if not cherrypy.session.get(key):
> File
"/var/lib/python-support/python2.4/cherrypy/filters/sessionfilter.py",
line 448, in __getattr__
> data = sess.session_storage.load(sess.session_id)
> File
"/var/lib/python-support/python2.4/cherrypy/filters/sessionfilter.py",
line 271, in load
> data = pickle.load(f)
> ValueError: insecure string pickle
> any ideas?
Any code you can show us?
Chris
Hi Chris,
This is my code. I have two functions set_session and get_session
to store and retrieve values into/from cherrypy session.
1. def set_session(key=None,value=None):
2. if cherrypy.session.id:
3. cherrypy.session[key] = value
4. def get_session(key=None):
5. if not cherrypy.session.get(key):
6. return
7. return cherrypy.session.get(key)
This error occurs in line 5 called by the following function:
def get_aziende(self, nome_o_codice=None, id_azienda=None,
id_distretto=None):
id_distretto=id_distretto or get_session('id_distretto')
...
File "/home/sfera/release/sicer/BASE/controller/get_functions.py", line 608,
in get_aziende
id_distretto=id_distretto or get_session('id_distretto')
File "/home/sfera/release/sicer/lib/session.py", line 29, in get_session
if not cherrypy.session.get(key):
File "/var/lib/python-support/python2.4/cherrypy/filters/sessionfilter.py",
line 448, in __getattr__
data = sess.session_storage.load(sess.session_id)
File "/var/lib/python-support/python2.4/cherrypy/filters/sessionfilter.py",
line 271, in load
data = pickle.load(f)
ValueError: insecure string pickle
j
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.