kernel.py:  don't close files in the kernel