uuDecode problem

Alex Martelli aleax at mail.comcast.net
Wed Dec 7 22:02:56 EST 2005


py <codecraig at gmail.com> wrote:
   ...
>     """data is a string"""
>     if len(data) > 45:
>         tmp = []
>         for c in data:
>             tmp.append(binascii.b2a_uu(c))

You can't decode b2a-encoded data character by character, blindly, as
you're trying to to here.  Each character in the source string can be
encoded into multiple characters in the target string, and the slicing,
if slicing is needed, must be appropriate.  I suggest a redesign...!


Alex



More information about the Python-list mailing list