pallets-eco / flask-session

Server side session extension for Flask
https://flask-session.readthedocs.io
BSD 3-Clause "New" or "Revised" License
507 stars 238 forks source link

datetime.timedelta.total_seconds object has no attribute 'total_seconds' #10

Closed command-tab closed 9 years ago

command-tab commented 9 years ago

I'm attempting to run Flask-Session 0.1.1 under Python 2.6.6, and am running into an issue right around this line (and others, if I was using those session storage methods):

 File "/var/www/appname/venv/lib/python2.6/site-packages/flask_session/sessions.py", line 118, in save_session
   int(app.permanent_session_lifetime.total_seconds()))
AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds'

It seems that datetime.timedelta.total_seconds was added in Python 2.7.

Is there by chance a 2.6-compatible drop-in replacement you'd consider?

Thanks!

fengsp commented 9 years ago

Thanks, noticed, I will fix it.