Fix string formatting ValueError in python2.6