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

[FIX] core: PyPDF2 suppresses warnings #60002

Closed

Commits on Oct 14, 2020

  1. [FIX] core: PyPDF2 suppresses warnings

    By default, PdfFileReader will monkeypatch the `warnings` module even
    if it has no reason whatsoever to do so and suppress the
    `captureWarnings` behavior.
    
    This means as soon as we've loaded a PDF file, `warnings.warn` don't
    trigger `logging` warnings anymore, and become invisible.
    
    This can lead to non-deterministic behaviors depending as warnings may
    or may not be suppressed depending when they occur relative to loading
    a PDF e.g. load a module which runs a test which loads a PDF before a
    module triggering a warning and the warning won't be visible, other
    way around it will.
    
    Except ofc while we have an override to PdfFileReader it's not
    used *everywhere*, so need to monkeypatch the init.
    xmo-odoo committed Oct 14, 2020
    Configuration menu
    Copy the full SHA
    a8292ec View commit details
    Browse the repository at this point in the history