Adding info to Python Buglist
Jason Trowbridge
ratman at nmt.edu
Mon Oct 18 18:11:23 EDT 1999
Thanks for pointing me to the newer RFC. Everyone *please* disregard
the previous patch. I jumped the gun a bit.
I've rewritten my code to fit according to RFC 2045. I also tightened
the code a bit & changed a few things. I've included the new patch with
this file. I'm going to submit the patch to the buglist. Please
comment on it.
Here's how to apply the patch in this message:
1) Go into your Python source directory & go into the Modules/
directory.
2) Make sure you have an unmodified Python 1.5.2 binascii.c file.
(Hint: "Jason Trowbridge" is not in the file ;)
3) Type: patch -N binascii.c binascii.patch
4) Recompile.
Current behavior of the modified binascii.c:
--Invalid characters are ignored, instead of possibly
being remapped to a valid base64 character
--Invalid pad sequences generate binascii.Error
exception (args = 'Invalid pad sequence')
--The pad character indicates an end of encoded input.
>From my previous patch:
--Fixed my find_valid() function
--Renamed find_valid() to binascii_find_valid() to prevent
symbol conflicts (oops)
--Valid pad sequence indicates end of encoded input instead
of being treated like a truncated quad
Jason Trowbridge
ratman at nmt.edu
Hrvoje Niksic wrote:
>
> Jason Trowbridge <ratman at nmt.edu> writes:
>
> > *The RFC I'm talking about is RFC 1521.
>
> Please note that rfc1521 has been obsoleted by rfc2045 *years* ago.
> Base64 encoding is described in section 6.8.
>
> Also, I'm not sure if ignoring invalid pad sequences is a good idea.
> rfc2045 explicitly says that characters out of the base64 alphabet are
> to be ignored. However, illegal padding is not mentioned.
>
> I think it makes sense to raise an exception in that case.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: binascii.patch
Type: application/octet-stream
Size: 3720 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/19991018/6d83f4a5/attachment.obj>
More information about the Python-list
mailing list