configuration.py ported for python2, changes aren't as ugly as thought.