Make exception handling forward compatible with python3
Call __unicode__ explicitly to allow for str(bug) usage in python3
Replace file() with open() for forward compatibility