Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: can't serialize python objects #12

Open
idf opened this issue Dec 25, 2015 · 0 comments
Open

TypeError: can't serialize python objects #12

idf opened this issue Dec 25, 2015 · 0 comments

Comments

@idf
Copy link

idf commented Dec 25, 2015

After installing django-php-bridge, I am unable to serialize some python objects not related to auth into request's session:

Traceback (most recent call last):
  File "venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 223, in get_response
    response = middleware_method(request, response)
  File "venv/local/lib/python2.7/site-packages/django/contrib/sessions/middleware.py", line 49, in process_response
    request.session.save()
  File "venv/local/lib/python2.7/site-packages/django/contrib/sessions/backends/db.py", line 58, in save
    session_data=self.encode(self._get_session(no_load=must_create)),
  File "/third_party/django_php_bridge/backends/db.py", line 57, in encode
    return phpserialize.dumps(wrapped_session_dict)
  File "/venv/local/lib/python2.7/site-packages/phpserialize.py", line 411, in dumps
    return _serialize(data, False)
  File "venv/local/lib/python2.7/site-packages/phpserialize.py", line 396, in _serialize
    out.append(_serialize(value, False))
  File "venv/local/lib/python2.7/site-packages/phpserialize.py", line 409, in _serialize
    raise TypeError('can\'t serialize %r' % type(obj))
TypeError: can't serialize <class 'SomeClass'>

Can you help regarding this issue?

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

No branches or pull requests

1 participant