Please use the `with` statement to avoid ResourceWarnings on Python 3.x and leaking file descriptors on PyPy.