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

Python 2.6 compatibility #112

Open
vondrt4 opened this issue Dec 9, 2014 · 4 comments
Open

Python 2.6 compatibility #112

vondrt4 opened this issue Dec 9, 2014 · 4 comments

Comments

@vondrt4
Copy link

vondrt4 commented Dec 9, 2014

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

@dsoprea
Copy link
Owner

dsoprea commented Dec 9, 2014

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

@vondrt4
Copy link
Author

vondrt4 commented Dec 11, 2014

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.

@dsoprea
Copy link
Owner

dsoprea commented Dec 12, 2014

What is "computed with true devision enabled"?

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

@vondrt4
Copy link
Author

vondrt4 commented Dec 12, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants