spy/cli: catch OSError in make_context