python2.6 compatibility and custom locale settings