format function fix for py2.6