Handle Unicode strings in Python 3.
Python 3 fixes.
Use Python context manager to ensure file is closed.
Use Python context manager to ensure file is closed.
Check for file existence in a sane way.