fix bug where str.format creates a ValueError on Python 2.6