-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
BUG: Don't close stream passed to PdfWriter.write() #2909
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2909 +/- ##
=======================================
Coverage 96.39% 96.39%
=======================================
Files 52 52
Lines 8730 8741 +11
Branches 1590 1590
=======================================
+ Hits 8415 8426 +11
Misses 186 186
Partials 129 129 ☔ View full report in Codecov by Sentry. |
I've created PR #2913 that also deals with Context manager. Consistency should be checked |
@stefan6419846 let me know how you'd like to proceed |
While I doubt that many users really rely on it, the deprecation process mentioned in https://github.com/py-pdf/pypdf/pull/2909/files#r1808253593 is still necessary as we are replacing a public attribute. |
The Windows CI test looks like a spurious failure due to a file missing from cache. I'm not sure what to do with the test coverage issues, as the lines cited are after the deprecation logic. |
Do not worry about the Windows CI - we will have a look at this. Windows does not use the cache for different reasons, but we are currently evaluating alternatives to the usually failing arXiv downloads while avoiding copyright issues. For the coverage, we tend to have a corresponding test which ensures the deprecation message being issued correctly (at least for past deprecations). This should work here as well by trying to read and write the value in one dedicated test function and looking into |
@stefan6419846 I tried to rely on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Looks good for me.
Closes #2905