mbr / flask-kvsession

A drop-in replacement for Flask's session handling using server-side sessions.
http://pythonhosted.org/Flask-KVSession/
MIT License
168 stars 53 forks source link

miniature fix for python 2.6 #29

Closed philmaweb closed 9 years ago

philmaweb commented 9 years ago

When using AWS and EC2 you are forced to use python <2.7. But total_seconds was added to timedelta in that version. This code should absolutely fix this timedelta problem for backwards comparability.

mbr commented 9 years ago

I've read up on timedelta and apparently, it's no relativedelta (so this "naive" approach is probably correct).

However, I'm loathe to add official Python 2.6 support: First, it would mean adding a new test configuration for Python 2.6, which is possible, but secondly it would be making a promise I do not intend to keep. If I am fixing this for Python 2.6 right now, there's no guarantee I won't be breaking it again in another place in the future. Since you are using this in production on EC2, I assume that that would be even worse?

philmaweb commented 9 years ago

Hmm, I guess you are right, it is too much of a hustle to support python 2.6. Also, I found a way to simply update the shipped python from amazon to 2.7, so all things fixed. Thanks for your support :)