GDriveFS icon indicating copy to clipboard operation
GDriveFS copied to clipboard

Python 2.6 compatibility

Open vondrt4 opened this issue 11 years ago • 4 comments

The version 0.13 worked for me on Debian Squeeze. I'm still having trouble with version 0.14, particularly with download. What I did so far: replace OrderedDict: http://stackoverflow.com/questions/14358162/funnelweb-error-cannot-import-ordereddict replace total_seconds: https://docs.python.org/2/library/datetime.html#datetime.timedelta.total_seconds

vondrt4 avatar Dec 09 '14 10:12 vondrt4

Please work through the other issue, and submit a PR. It'll be much quicker.

dsoprea avatar Dec 09 '14 17:12 dsoprea

It's a one-liner, maybe two: In time_support.py, change seconds = datetime_obj.utcoffset().total_seconds() to td = datetime_obj.utcoffset() seconds = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 106) / 106

In the manual, there is a footnote "computed with true division enabled". Can it be a problem? And it creates a problem with Upload. Download fixed by #111.

vondrt4 avatar Dec 11 '14 21:12 vondrt4

What is "computed with true devision enabled"?

The change that you're suggesting breaks uploads? How?

dsoprea avatar Dec 12 '14 05:12 dsoprea

No, the change fixes uploads on Python 2.6 which doesn't have the total_seconds() function. I'm concerned if it doesn't lose precision as I don't understand that comment from the manual either.

vondrt4 avatar Dec 12 '14 08:12 vondrt4