Bug: Input file handle is never closed, causing a ResourceWarning in Python 3.11+
Author: DeflateAwningCreated Oct 6, 2025Updated Mar 26, 2026
Labelsbug
Describe the bug
The input file handle doesn't appear to be closed properly in a variety of code paths, resulting in a ResourceWarning in modern Python versions. It would be great if this library automatically closed the handle properly.
Using context managers on file access is the best/proper way to solve this issue!
Source: jsvine/pdfplumber