python2.6 compatibility and custom locale settings

care for a merge?