file() has been removed, replace print
Sanitize exceptions, no need for import from future