Skip to content
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

Unclosed Resource Warnings #2

Open
sfneal opened this issue Aug 24, 2018 · 4 comments
Open

Unclosed Resource Warnings #2

sfneal opened this issue Aug 24, 2018 · 4 comments
Labels
bug Something isn't working question Further information is requested

Comments

@sfneal
Copy link
Owner

sfneal commented Aug 24, 2018

Running test_flatten.py yields a number of UnclosedResource warnings. Using the pdfrw method instead of pypdf3 during Merge call in Flatten seemed to limit the number of warnings but not eliminate them. PyPDF3 appears to be the origin of the problem.

@sfneal
Copy link
Owner Author

sfneal commented Aug 28, 2018

It appears that the source of UnclosedResource warnings has been fixed based on MacOS tests. Not sure what was changed that resulted in the fix. Has not been tested on Windows 10 (Windows 10 was raising more errors than MacOS).

@sfneal
Copy link
Owner Author

sfneal commented Aug 28, 2018

Windows 10 test_flatten.py console output

Launching unittests with arguments python -m unittest C:/Users/Stephen/Scripts/pdfconduit/tests/test_flatten.py in C:\Users\Stephen\Scripts\pdfconduit\tests
ResourceWarning: unclosed file <_io.BufferedRandom name=3> [flatten.py:94]
ResourceWarning: unclosed file <_io.BufferedRandom name=3> [pdf.py:54]
flatten 1x --> 2.527738332748413
flatten 2x --> 5.085687160491943
flatten 3x --> 9.904916048049927

Ran 3 tests in 17.690s

OK

@sfneal sfneal added bug Something isn't working question Further information is requested labels Sep 14, 2018
@sfneal
Copy link
Owner Author

sfneal commented Sep 24, 2018

Unclosed resource warnings have completely disappeared from macOS tests. Testings Windows 10 now

@sfneal
Copy link
Owner Author

sfneal commented Sep 24, 2018

Flatten module still causing unclosed file warnings to be raised.

C:/Users/Stephen/Scripts/pdfconduit/tests\test_flatten.py
ResourceWarning: unclosed file <_io.BufferedRandom name=3> [pdf2img.py:81]
ResourceWarning: unclosed file <_io.BufferedRandom name=3> [pdf.py:55]
tests test_flatten TestFlatten test_flatten_1x --> 31.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant