FIX: Py3k

cc @mainakjas

The try/finally was necessary to avoid an error in testing due to an unclosed-file warning throwing off a warning count. The other change is to suppress warnings during testing. Ready for review/merge.