Fix for locale related issues while running the tests.


* Fix for locale related issues while running the tests.
* Fix for a datetime.format() issue behaving differently in python2 and python3 for locales returning non ascii strings.