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 versions < 2.6 #3

Closed
bbn opened this issue May 12, 2012 · 6 comments
Closed

Python versions < 2.6 #3

bbn opened this issue May 12, 2012 · 6 comments

Comments

@bbn
Copy link

bbn commented May 12, 2012

Using Python 2.5.6 on a mac laptop. Trying to import the library but it fails trying to import json library. I can add one easily enough, but I imagine you want this to work out of the box as much as possible!

Python 2.5.6 (r256:88840, Jul 31 2011, 19:30:45) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from simperium.core import Auth
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "simperium/core.py", line 6, in <module>
    import json
ImportError: No module named json
>>> 
@bbn
Copy link
Author

bbn commented May 12, 2012

OK, obvs the issue is that I am using a version of Python < 2.6, which is when the json library was added. I have been keeping my python at 2.5.x because that's the default for app engine. I think it would be great to support versions of Python prior to 2.6, but recommend that for now at the very least your documentation note the requirement of Python 2.6.

@bbn
Copy link
Author

bbn commented May 12, 2012

Also discovered another 2.6+ compatibility problem: the timeout attribute in urllib2.urlopen. Have worked around it in my fork. Can send you a pull request if you want to support < 2.6.

@cablehead
Copy link
Contributor

Yeah, could you send through a pull request bbn. Curious as to the approach you used for the missing timeout in urllib2.urlopen. Gotcha re the json import. I'll add a conditional import which pulls in simplejson if the builtin json isn't available.

@cablehead
Copy link
Contributor

Actually, can see the change here: bbn@ff7e90f -- Nice, I'll update our version with this approach.

@cablehead
Copy link
Contributor

Thanks bbn, I've incorporated these changes. Rather than including simplejson in our repo, I've made it a conditional dependency in setup.py for python clients < 2.6

@bbn
Copy link
Author

bbn commented May 14, 2012

glad if I helped!

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