You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
base64.a85decode adobe flag incorrectly utilizes <~ as a marker causing error #70101
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/serhiy-storchaka'closed_at=<Date2016-02-24.10:13:00.441>created_at=<Date2015-12-19.23:31:52.977>labels= ['type-bug', 'library']
title='base64.a85decode adobe flag incorrectly utilizes <~ as a marker causing error'updated_at=<Date2016-02-24.10:13:00.439>user='https://bugs.python.org/SorenSolari'
According to the PDF Spec http://www.adobe.com/devnet/pdf/pdf_reference.html section 7.4.3,
The ascii85decode function only utilizes ~> as an EOD 2byte character, there is no mention of leading <. Therefore using the base64.a85decode(data, adobe=True) does not work on valid data coming from a pdf because that data may not have a leading <.
Solution: do not require leading <~ for adobe=True.
The proposed patch does stop requiring the leading <~, but still trims the first two characters off the data set. This will no doubt fail in cases where there is no leading marker.
I think it will need to explicitly handle the case where the leading marker is there vs. not.
Soren, for me, the page you link to is impossible to read as it blinks every second or so, something I have never seen before. Perhaps it is trying to forward to the actual reference. As near as I can tell, it just lists about 3 other documents and is not a reference in itself, and for me has no sections. Can you provide a better link, perhaps one that is more direct?
curioswati commented on Jan 15, 2016
curioswatimannequin
Mannequin
More actions
Modified according to Serhiy's last comment.
curioswati commented on Feb 7, 2016
curioswatimannequin
Mannequin
More actions
Is there any requirement for further modification or it can be accepted?
Activity
SorenSolari commentedon Dec 19, 2015
According to the PDF Spec http://www.adobe.com/devnet/pdf/pdf_reference.html section 7.4.3,
The ascii85decode function only utilizes ~> as an EOD 2byte character, there is no mention of leading <
. Therefore using the base64.a85decode(data, adobe=True) does not work on valid data coming from a pdf because that data may not have a leading <.Solution: do not require leading <~ for adobe=True.
isoschiz commentedon Dec 22, 2015
The proposed patch does stop requiring the leading <~, but still trims the first two characters off the data set. This will no doubt fail in cases where there is no leading marker.
I think it will need to explicitly handle the case where the leading marker is there vs. not.
terryjreedy commentedon Jan 12, 2016
Soren, for me, the page you link to is impossible to read as it blinks every second or so, something I have never seen before. Perhaps it is trying to forward to the actual reference. As near as I can tell, it just lists about 3 other documents and is not a reference in itself, and for me has no sections. Can you provide a better link, perhaps one that is more direct?
curioswati commentedon Jan 15, 2016
Modified according to Serhiy's last comment.
curioswati commentedon Feb 7, 2016
Is there any requirement for further modification or it can be accepted?
serhiy-storchaka commentedon Feb 7, 2016
Martin, Antoine, what would you say about this?
isoschiz commentedon Feb 20, 2016
3.patch looks good to me.
python-dev commentedon Feb 24, 2016
New changeset ce5bf3290621 by Serhiy Storchaka in branch '3.5':
Issue bpo-25913: Leading <~ is optional now in base64.a85decode() with adobe=True.
https://hg.python.org/cpython/rev/ce5bf3290621
New changeset 90d5473b8673 by Serhiy Storchaka in branch 'default':
Issue bpo-25913: Leading <~ is optional now in base64.a85decode() with adobe=True.
https://hg.python.org/cpython/rev/90d5473b8673
serhiy-storchaka commentedon Feb 24, 2016
Thank you Soren for your report, thank you Swati for your patch, and thank you Martin for your review.