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

ROB: Capture UnicodeDecodeError at PdfReader.pdf_header #1768

Merged
merged 3 commits into from
Apr 6, 2023

Conversation

pubpub-zz
Copy link
Collaborator

@pubpub-zz pubpub-zz commented Apr 4, 2023

fixes #1758
This is an alternative which also reports when "opening" the file a damaged header
Change to the check of footer (log in case of not strict) should be better for linearization
also pdf_header should report the actual header for better understanding

@pubpub-zz
Copy link
Collaborator Author

@MartinThoma
This is an alternative providing more details. Your opinion ?

@codecov
Copy link

codecov bot commented Apr 5, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (b385ce9) 92.41% compared to head (e68fc8a) 92.41%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1768   +/-   ##
=======================================
  Coverage   92.41%   92.41%           
=======================================
  Files          34       34           
  Lines        6576     6581    +5     
  Branches     1301     1302    +1     
=======================================
+ Hits         6077     6082    +5     
  Misses        326      326           
  Partials      173      173           
Impacted Files Coverage Δ
pypdf/_reader.py 91.24% <100.00%> (+0.04%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MartinThoma MartinThoma changed the title ROB: Capture UnicodeDecodeError at PdfReader.pdf_header (alternative= ROB: Capture UnicodeDecodeError at PdfReader.pdf_header Apr 6, 2023
@MartinThoma MartinThoma added the is-robustness-issue From a users perspective, this is about robustness label Apr 6, 2023
@MartinThoma MartinThoma merged commit 8146729 into py-pdf:main Apr 6, 2023
@MartinThoma
Copy link
Member

I love it ❤️

@pubpub-zz pubpub-zz deleted the header-fix2 branch April 6, 2023 16:43
MartinThoma added a commit that referenced this pull request Apr 9, 2023
Security (SEC):
-  Warn about PDF encryption security (#1755)

Robustness (ROB):
-  Prevent loop in Cloning (#1770)
-  Capture UnicodeDecodeError at PdfReader.pdf_header (#1768)

Documentation (DOC):
-  Pin myst_parser==0.16.1 and rename .readthedocs.yaml (#1752)
-  Add readthedocs.yml and bump docs dependencies using `tox -e deps` (#1750)

Developer Experience (DEV):
-  Make make_changelog.py idempotent

Maintenance (MAINT):
-  Move generation of file identifiers to a method (#1760)

Testing (TST):
-  Add xmp test (#1775)

Code Style (STY):
-  Improve language, add docstrings, fix TODOs (#1772)
-  Test names, docstrings, and parametrization (#1771)

[Full Changelog](3.7.0...3.7.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is-robustness-issue From a users perspective, this is about robustness
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UnicodeDecodeError 'utf-8' codec can't decode byte 0xac in position 0: invalid start byte
2 participants