While reviewing Python iterators contexts, a file remains open after an exception. Which action fixes it, and which check proves it worked?
Answer options
- A. Use a with statement
- B. Verify cleanup runs on success and failure
- C. Use an async context manager
- D. Expose an iterator over rows