more gracefully handle situation where fileobj does not have a name