List Info

Thread: File based session yields "TypeError: can't pickle generator objects"




File based session yields "TypeError: can't pickle generator objects"
country flaguser name
United States
2007-09-26 10:02:01
Hi All,

I am trying to use file based sessions in my turbogears
(1.0.2.2)
application (CherryPy-2.2.1). While logging out, it displays
the error
given below. Unable to guess what can be the reason. Badly
needing
help.

thanks in advance
Sanjay


URL: http://localhost:8080/lo
gout
Module paste.evalexception.middleware:293 in respond
<<              app_iter = self.application(environ,
detect_start_response)
                try:
                    return_iter = list(app_iter)
                    return return_iter
                finally:>>  return_iter =
list(app_iter)
Module cherrypy._cpwsgi:75 in wsgiApp
<<          response =
request.run(requestLine(environ),
                                  
translate_headers(environ),
                                   environ['wsgi.input'])
            s, h, b = response.status,
response.header_list,
response.body
            exc = None>>  environ['wsgi.input'])
Module cherrypy._cphttptools:72 in run
<<              cherrypy.profiler.run(self._run)
            else:
                self._run()

            if self.method == "HEAD":>> 
self._run()
Module cherrypy._cphttptools:120 in _run
<<                      inst.set_response()
                        applyFilters('before_finalize')
                        cherrypy.response.finalize()
                finally:
                    applyFilters('on_end_resource',
failsafe=True)>>
cherrypy.response.finalize()
Module cherrypy._cphttptools:404 in finalize
<<              # but allow user code to set
Content-Length if
desired.
                if self.headers.get('Content-Length') is
None:
                    content = self.collapse_body()
                    self.headers['Content-Length'] =
len(content)>>
content = self.collapse_body()
Module cherrypy._cphttptools:375 in collapse_body
<<
        def collapse_body(self):
            newbody = ''.join([chunk for chunk in
self.body])
            self.body = newbody
            return newbody>>  newbody = ''.join([chunk
for chunk in
self.body])
Module cherrypy._cphttptools:343 in flattener
<<  def flattener(input):
        """Yield the given input, recursively
iterating over each
result (if needed)."""
        for x in input:
            if not isinstance(x, types.GeneratorType):
                yield x>>  for x in input:
Module cherrypy.filters.sessionfilter:177 in saveData
<<                  expiration_time =
datetime.datetime.now() + t
                   
sess.session_storage.save(sess.session_id,
                            sess.session_data,
expiration_time)
                else:
                    # If session data has never been loaded
then it's
never been>>  sess.session_data, expiration_time)
Module cherrypy.filters.sessionfilter:280 in save
<<          file_path = self._get_file_path(id)
            f = open(file_path, "wb")
            pickle.dump((data, expiration_time), f)
            f.close()>>  pickle.dump((data,
expiration_time), f)
Module copy_reg:69 in _reduce_ex
<<      else:
            if base is self.__class__:
                raise TypeError, "can't pickle %s
objects" %
base.__name__
            state = base(self)
        args = (self.__class__, base, state)>>  raise
TypeError,
"can't pickle %s objects" % base.__name__
exceptions.TypeError: can't pickle generator objects


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )