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

test_issue_1089 should not assume a low NO_FILE limit #1263

Open
booxter opened this issue Jan 26, 2025 · 1 comment
Open

test_issue_1089 should not assume a low NO_FILE limit #1263

booxter opened this issue Jan 26, 2025 · 1 comment
Labels

Comments

@booxter
Copy link

booxter commented Jan 26, 2025

Describe the bug

A clear and concise description of what the bug is.

The test case iterates over the number of allowed files to open, doing work. Then checks that the test suite survived. The problem is that the test case assumes that the soft limit for the allowed files to open is "reasonably" low. When I run the suite on my Darwin machine where it's 1048576, the test never completes.

This can be worked around by setting the limit to something "reasonable" with ulimit -n 1024. But this is a workaround, and the test suite should not include test cases that rely on platform specific settings. I'd think there are better ways to confirm that leaks are not happening, e.g. the test case could check that the number of currently opened files doesn't grow drastically, whatever it means.

Have you tried repairing the PDF?

Please try running your code with pdfplumber.open(..., repair=True) before submitting a bug report.

Code to reproduce the problem

Paste it here, or attach a Python file.

PDF file

Please attach any PDFs necessary to reproduce the problem.

If you need to redact text in a sensitive PDF, you can run it through JoshData/pdf-redactor.

Expected behavior

What did you expect the result should have been?

Actual behavior

What actually happened, instead?

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

  • pdfplumber version: 0.11.5
  • Python version: Any (python3.11 or python3.12, doesn't matter)
  • OS: Darwin (but really, can be any platform because limits are not OS-dependent)

Additional context

Add any other context/notes about the problem here.

@booxter booxter added the bug label Jan 26, 2025
@jsvine
Copy link
Owner

jsvine commented Jan 27, 2025

Thank you for this bug report. I'll look into modifying that test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants