Ensure file handle is closed using with statement (core.py)
Merge pull request #2 from svisser/patch-2

Ensure file handle is closed using with statement (core.py)