allow file-like object to be passed, bypassing FileWrapper