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

TimedSerializer.loads() raises an error when return_timestamp=True #3

Closed
dnicolodi opened this issue Aug 17, 2011 · 0 comments
Closed

Comments

@dnicolodi
Copy link
Contributor

Here is the traceback:

>>> s = itsdangerous.TimedSerializer('a')
>>> token = s.dumps('hello')
>>> s.loads(token)
u'hello'
>>> s.loads(token, return_timestamp=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/private/tmp/dateutils/lib/python2.6/site-packages/itsdangerous.py", line 275, in loads
    return self.load_payload(base64d)
  File "/private/tmp/dateutils/lib/python2.6/site-packages/itsdangerous.py", line 220, in load_payload
    return self.serializer.loads(payload)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/__init__.py", line 307, in loads
    return _default_decoder.decode(s)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 319, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: expected string or buffer
dnicolodi added a commit to dnicolodi/itsdangerous that referenced this issue Aug 17, 2011
Make TimedSerializer.loads() not to raise an error when
return_timestamp=True.
mitsuhiko added a commit that referenced this issue Aug 18, 2011
Fix issue #3 and add proper unit test.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants