format function fix for py3.2