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

models.py line 30 def to_python #3

Open
ralphleyga opened this issue Mar 16, 2011 · 1 comment
Open

models.py line 30 def to_python #3

ralphleyga opened this issue Mar 16, 2011 · 1 comment

Comments

@ralphleyga
Copy link

Hi,

I found an error in your activity stream,

def to_python(self, value):
if value is None: return
if not isinstance(value, basestring): return value
value = pickle.loads(base64.b64decode(value))
return value

ERROR:
return base64.b64decode(value)
File "/usr/lib/python2.6/base64.py", line 76, in b64decode
raise TypeError(msg)
TypeError: Incorrect padding

This works for me:

def to_python(self, value):
    try:
        if value is None: return
        if not isinstance(value, basestring): return value
        value = pickle.loads(base64.b64decode(value))
        return value
    except TypeError:
        return value
@philippWassibauer
Copy link
Owner

Thanks for mentioning this. I personally use justquicks activity stream now, since it is easier to set up and manage and you should do the same if you have not started using this one yet.

I don't have time to look into this problem at the moment since I have deadlines with other projects, if possible send me a pull request.

thanks
phil

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

2 participants