Add python3 compatibility
The codebase has been currently written for python2. It's mostly been written for compatibility in mind, but there are several places where this will break compatibility.
This list is not complete, but there are two places where this will certainly cause issues:
-
httplib
,urllib
,urllib2
: functions and classes have been shuffled around from python2 to 3. This affectsinflux.py
andhttp.py
. This can be fixed by importingsix
and using those functions/classes to handle this in a nice manner. - Derek caught another issue having to do with wrapping the arguments of a function in a tuple like so:
def func((arg1, arg2, arg3)):
. This doesn't appear to work with python 3, but is a workaround for passing in multiple arguments inmultiprocessing.map()
. There is a a new function only available with python 3,multiprocessing.starmap()
that fixes this issue. I don't currently know a way of cleanly handling both cases.
There may be more issues. In either case, using six
to handle problems like this is fine. If there's a clean solution without using six
, I'd rather lean against gratuitous use of this library.