-
Notifications
You must be signed in to change notification settings - Fork 245
Closed
Description
I'm using session with MongoDB and it fails because of a datetime error.
TypeError: can't compare offset-naive and offset-aware datetimes
File "/Library/Python/2.7/site-packages/flask/app.py", line 2000, in __call__
return self.wsgi_app(environ, start_response)
File "/Library/Python/2.7/site-packages/flask/app.py", line 1984, in wsgi_app
ctx.push()
File "/Library/Python/2.7/site-packages/flask/ctx.py", line 332, in push
self.session = self.app.open_session(self.request)
File "/Library/Python/2.7/site-packages/flask/app.py", line 914, in open_session
return self.session_interface.open_session(self, request)
File "/Library/Python/2.7/site-packages/flask_session/sessions.py", line 411, in open_session
if document and document.get('expiration') <= datetime.utcnow():
TypeError: can't compare offset-naive and offset-aware datetimes
I had recently faced a similar issue while checking expiry of a token. Handled it with using a different datetime format.
I believe we need to use any other format like:
datetime.datetime.strptime(,"%d %b %Y %I:%M:%S %p")
Mongo Version : 3.4
Flask-Session==0.3.0
Metadata
Metadata
Assignees
Labels
No labels