-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ResourceWarning: unclosed file
inside offset_rendering
context manager
#1356
Comments
Hi @stenci Thank you for the issue report 👍 Would you mind providing a minimal bug-reproduction code snippet, please? Because without knowing how precisely you use |
Hi @Lucas-C I tried to reproduce the problem, and I found out that it only reproduces while running in a unittest If you are still interested, I have attached two scripts. They use the same This is the output I see:
|
I have noticed a
ResourceWarning: unclosed file
warning shown when working inside awith self.offset_rendering() as dummy:
context manager. (I use the context manager to know whether what I am adding will fit in the page or not.)I add the fonts in the class constructor, something like this:
And the full warning is:
I am using
fpdf2
version 2.7.7.Please let me know if this is a known issue or it is not an issue, or if you are interested in further digging or in a small reproducible example.
The text was updated successfully, but these errors were encountered: