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 : improve nameobject reading/writing #1345

Merged
merged 2 commits into from
Sep 14, 2022
Merged

Conversation

pubpub-zz
Copy link
Collaborator

closes #1344

@pubpub-zz
Copy link
Collaborator Author

Ready for review and testing . I will add later some comments about changes

@Merinorus
Copy link

Unfortunately, it doesn't seem to pass CI, but the issue #1344 is fixed with this PR

@codecov
Copy link

codecov bot commented Sep 13, 2022

Codecov Report

Base: 94.62% // Head: 94.62% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (53aad08) compared to base (e23b985).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1345   +/-   ##
=======================================
  Coverage   94.62%   94.62%           
=======================================
  Files          30       30           
  Lines        5118     5137   +19     
  Branches     1052     1058    +6     
=======================================
+ Hits         4843     4861   +18     
  Misses        164      164           
- Partials      111      112    +1     
Impacted Files Coverage Δ
PyPDF2/_page.py 94.36% <ø> (ø)
PyPDF2/_cmap.py 95.08% <100.00%> (-0.03%) ⬇️
PyPDF2/generic/_base.py 100.00% <100.00%> (ø)
PyPDF2/_utils.py 99.43% <0.00%> (-0.57%) ⬇️

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 at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pubpub-zz
Copy link
Collaborator Author

more details on mod:
a) _cmap.py : the str is coming from "/Encoding" which stores a NameObject : the conversion is already performed no need to force it.
b) _page.py : Obsolete called missed in _debug_for_extract()
c) _base.py:
unnumber : all #xx should be performed prior to conversion to str (using utf-8) to allow multi language text:
image
read_from_stream : if utf-8 (normally the only one required) or gbk (kept to prevent regression) we will use charmap to get some sequence of chars
renumber : added to recode in #xx sequence :
image
renumber will also be compatible with utf-8 chars

else test added (some test were not iaw pdf spec and have been corrected)
a test using the pdf from the issue has been added in test_merger

@MartinThoma MartinThoma merged commit fb8be40 into py-pdf:main Sep 14, 2022
@MartinThoma
Copy link
Member

Thank you @pubpub-zz 🙏

I will make a release to PyPI in a few minutes.

@pubpub-zz pubpub-zz deleted the iss1344 branch September 14, 2022 11:00
MartinThoma added a commit that referenced this pull request Sep 14, 2022
New Features (ENH):
-  Add PageObject.user_unit property (#1336)

Robustness (ROB):
-  Improve NameObject reading/writing (#1345)

Full Changelog: 2.10.7...2.10.8
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.

PDF Read/Merge generates broken documents since update 2.10.6
3 participants