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

Make PyMuPDF always log to stderr #879

Merged
merged 2 commits into from
Aug 9, 2024
Merged

Make PyMuPDF always log to stderr #879

merged 2 commits into from
Aug 9, 2024

Conversation

apyrgio
Copy link
Contributor

@apyrgio apyrgio commented Jul 25, 2024

PyMUPDF logs to stdout by default, which is problematic because we use the stdout of the conversion process to read the pixel stream of a document.

Make PyMuPDF always log to stderr, by setting the following environment variables: PYMUPDF_MESSAGE and PYMUPDF_LOG.

Also, set a 5 minute timeout for document processing, when we run our large tests.

Fixes #877
Refs #878

Copy link
Member

@legoktm legoktm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM based on what upstream enabled, but setting environment variables at runtime to modify the environment is pretty hacky and it would be nice if they offered something better :/

apyrgio added 2 commits August 9, 2024 14:32
PyMUPDF logs to stdout by default, which is problematic because we use
the stdout of the conversion process to read the pixel stream of a
document.

Make PyMuPDF always log to stderr, by setting the following environment
variables: PYMUPDF_MESSAGE and PYMUPDF_LOG.

Fixes #877
Some of the files in our large test set can make LibreOffice hang. We
do not have a proper solution for this yet, but we can at least make
the tests timeout quickly, so that they can finish at some point.

Refs #878
@apyrgio apyrgio force-pushed the 877-reduce-errors branch from d41b840 to cfb5e75 Compare August 9, 2024 11:32
@apyrgio apyrgio merged commit cfb5e75 into main Aug 9, 2024
13 of 17 checks passed
@apyrgio apyrgio deleted the 877-reduce-errors branch August 9, 2024 11:32
@apyrgio
Copy link
Contributor Author

apyrgio commented Aug 9, 2024

Yeap, it's too hacky for my liking, and I've opened an issue for that. Anw, we have to live with it...

Thanks for the review!

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

Successfully merging this pull request may close these issues.

Make PyMuPDF always log to stderr
2 participants