Fix decode exception catching to use the proper exception

One commit fixes the pep8 issues with core/text/__init__.py because it wouldn't let me commit my changes in that file until the pep8 issues of that file has been fixed. 

The second commit replaces the attempted catching of the unicode encode exception with the proper unicode decode exception when calling text.decode().