Issue 25913: base64.a85decode adobe flag incorrectly utilizes <~ as a marker causing error (original) (raw)

Created on 2015-12-19 23:31 by Soren Solari, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
iss_25913.patch curioswati,2015-12-21 05:34 Fix on the basis of comments. review
iss_25913_2.patch curioswati,2015-12-23 04:41 review
iss_25913_3.patch curioswati,2016-01-15 05:48 Corrects the test. review
Messages (9)
msg256745 - (view) Author: Soren Solari (Soren Solari) Date: 2015-12-19 23:31
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.
msg256842 - (view) Author: Martin Morrison (isoschiz) * Date: 2015-12-22 16:10
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.
msg258080 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-01-12 08:50
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?
msg258268 - (view) Author: Swati Jaiswal (curioswati) * Date: 2016-01-15 05:48
Modified according to Serhiy's last comment.
msg259767 - (view) Author: Swati Jaiswal (curioswati) * Date: 2016-02-07 07:11
Is there any requirement for further modification or it can be accepted?
msg259802 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-02-07 21:04
Martin, Antoine, what would you say about this?
msg260570 - (view) Author: Martin Morrison (isoschiz) * Date: 2016-02-20 18:24
3.patch looks good to me.
msg260781 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-02-24 10:08
New changeset ce5bf3290621 by Serhiy Storchaka in branch '3.5': Issue #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 #25913: Leading <~ is optional now in base64.a85decode() with adobe=True. https://hg.python.org/cpython/rev/90d5473b8673
msg260782 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-02-24 10:13
Thank you Soren for your report, thank you Swati for your patch, and thank you Martin for your review.
History
Date User Action Args
2022-04-11 14:58:25 admin set github: 70101
2016-02-24 10:13:00 serhiy.storchaka set status: open -> closedmessages: + assignee: serhiy.storchakaresolution: fixedstage: test needed -> resolved
2016-02-24 10:08:34 python-dev set nosy: + python-devmessages: +
2016-02-20 18:24:14 isoschiz set messages: +
2016-02-07 21:04:58 serhiy.storchaka set messages: +
2016-02-07 07:11:44 curioswati set messages: +
2016-01-15 05:48:09 curioswati set files: + iss_25913_3.patchmessages: +
2016-01-12 21:04:24 zach.ware set nosy: + curioswati
2016-01-12 08:50:27 terry.reedy set nosy: + terry.reedymessages: + stage: test needed
2015-12-23 04:41:59 curioswati set files: + iss_25913_2.patch
2015-12-22 16:10:12 isoschiz set messages: +
2015-12-21 05:34:09 curioswati set files: + iss_25913.patchkeywords: + patch
2015-12-19 23:52:26 serhiy.storchaka set nosy: + pitrou, serhiy.storchaka, isoschizcomponents: + Library (Lib)versions: + Python 3.6
2015-12-19 23:31:52 Soren Solari create