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 logistix
Recipients
Date 2005-03-27.21:43:09
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=699438

Updated patch to reflect another fix.

I originally thought the bug was related to cleanup of a
partial quanta.  It will trigger on any quanta where the
initial hex value is < 0x10.  When this happens part of the
hex code disappears in the initial conversion and is
mistakenly swallowed.  The hex function that was originally
used doesn't zero-pad, but the way the bit shifting works,
it doesn't need to when encoding normal alpha-numeric
characters, so it seemed to work correctly.

This will only cause problems if you are using a character
value of < 0x10 in the 0th, 4th, 8th, 12th, etc positions in
the encoded string.  Otherwise it'll work properly.  Using
"%010x" ensures that you'll get the appropriate zero-padding
if necessary.

Example of more broken code not covered in the original bug:

>>> base64.b32decode(base64.b32encode('\x00aaa'))
'aaa'

Updated patch fixes this case as well.
History
Date User Action Args
2007-08-23 15:42:22adminlinkissue1171487 messages
2007-08-23 15:42:22admincreate