MatthiasValvekens / pyHanko

pyHanko: sign and stamp PDF files
MIT License
483 stars 71 forks source link

Treat nulls the same as missing entries in dicts #263

Closed MatthiasValvekens closed 1 year ago

MatthiasValvekens commented 1 year ago

Description of the changes

Compliance point: nulls should be treated equivalently to missing entries in dictionaries (not in arrays, though!) per the processor requirements in the PDF spec.

Issue #261 was a symptom of this, and is addressed by this fix (in nonstrict mode only; pyHanko deliberately does not substitute nulls for unresolvable references in strict mode, even though that is what the letter of the spec requires).

Checklist

Please go over this checklist to increase the chances of your PR being worked on in a timely manner. Deviations are allowed with proper justification (see previous section).

For bug fixes (delete if not applicable)

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (79b64d7) 98.13% compared to head (ba28b83) 98.14%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #263 +/- ## ======================================= Coverage 98.13% 98.14% ======================================= Files 104 104 Lines 14535 14538 +3 ======================================= + Hits 14264 14268 +4 + Misses 271 270 -1 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `98.14% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthias+Valvekens#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://app.codecov.io/gh/MatthiasValvekens/pyHanko/pull/263?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthias+Valvekens) | Coverage Δ | | |---|---|---| | [pyhanko/pdf\_utils/generic.py](https://app.codecov.io/gh/MatthiasValvekens/pyHanko/pull/263?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthias+Valvekens#diff-cHloYW5rby9wZGZfdXRpbHMvZ2VuZXJpYy5weQ==) | `97.22% <100.00%> (+0.01%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/MatthiasValvekens/pyHanko/pull/263/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthias+Valvekens)

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