This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author leecannon
Recipients leecannon
Date 2017-05-27.20:45:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1495917948.16.0.130856040345.issue30493@psf.upfronthosting.co.za>
In-reply-to
Content
Added tests to ensure a85decode correctly handles the 'y' character within the byte like object when foldspaces is true.


While attempting to increase coverage I found two lines of code within base64.py that appear to never execute:
  - line 472
  - line 501


Line 472:
The only time the TypeError except block (line 467) executes is when _b85dec[c] resolves to None for one of the c (characters) in chunk.

Then within the except block the c (characters) within chunk are iterated through until the None is hit then a ValueError is raised (line 470). Making it impossible for line 472 to execute.


Line 501:
s is assigned a value in the expression `s = input.read(MAXBINSIZE)` (line 494), due to this len(s) is only ever not equal to MAXBINSIZE if the end of input has been reached and nothing was read or the last chunk of data was read from input which has a len less than MAXBINSIZE but non-zero.

Therefore the only way to enter into the while loop (line 497) is if there are no more characters left to be read from input, yet all that happens in the while loop is the read function is called on input with a non zero parameter (`MAXBINSIZE-len(s)` must be greater than zero for the while to have executed) then when it returns nothing (it always will) execution breaks out of the while loop without modifiying s.
History
Date User Action Args
2017-05-27 20:45:48leecannonsetrecipients: + leecannon
2017-05-27 20:45:48leecannonsetmessageid: <1495917948.16.0.130856040345.issue30493@psf.upfronthosting.co.za>
2017-05-27 20:45:48leecannonlinkissue30493 messages
2017-05-27 20:45:47leecannoncreate