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

Be more lenient with try/except in _showwarning #452

Closed
wants to merge 4 commits into from
Closed

Be more lenient with try/except in _showwarning #452

wants to merge 4 commits into from

Conversation

bozdoz
Copy link

@bozdoz bozdoz commented Aug 14, 2018

Was getting an IndexError from the formatWarning function. Alternatively, you could alter that function to check for values before trying to get a value from an index.

Was getting an IndexError from the `formatWarning` function.  Alternatively, you could alter that function to check for values before trying to get a value from an index.
@bozdoz
Copy link
Author

bozdoz commented Aug 14, 2018

Related to #67

@moser
Copy link

moser commented Sep 17, 2018

@bozdoz: May I suggest to use
except Exception:
instead the bare except? :-)
see https://moserei.de/2017/09/20/python-bare-except.html

@bozdoz
Copy link
Author

bozdoz commented Sep 17, 2018

@moser done

mlissner added a commit to freelawproject/courtlistener that referenced this pull request Mar 23, 2022
In the following issues and PRs, PyPDF2 users have identified and
offered to fix a weird bug where the library overrides normal logging
in a way that breaks when you log certain things:

py-pdf/pypdf#67
py-pdf/pypdf#641
py-pdf/pypdf#452
py-pdf/pypdf#243

Not great, but there was probably a reason. Unfortunately, the
maintainers aren't merging any of the fixes people have provided
over the years, and when I upgraded to Python 3.10 one of our tests
changed in a way that it triggered this bug.

So, since the maintainers don't seem inclined to fix their own
package, this commit yanks it from CourtListener. It's good timing,
really, since we now have the microservice available, but it was
disappointing to see bugs and PRs related to this going back to 2014.
Most of the fixes are one or two-line PRs too. Bummer.
@MartinThoma MartinThoma added the Tiny Pull requests that make a tiny change - and thus should be easy to merge label Apr 6, 2022
PyPDF2/pdf.py Outdated Show resolved Hide resolved
@MartinThoma
Copy link
Member

That issue was fixed via https://github.com/py-pdf/PyPDF2/pull/612/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tiny Pull requests that make a tiny change - and thus should be easy to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants