uuDecode problem

Alex Martelli aleax at mail.comcast.net
Fri Dec 9 16:44:05 CET 2005

py <codecraig at gmail.com> wrote:

> Alex Martelli wrote:
> I suggest a redesign...!
> What would you suggest?  I have to encode/decode in chunks b/c of the
> 45 byte limitation.

Not quite:

>>> s=45*'v'
>>> a=binascii.b2a_uu(s)
>>> len(a)
>>> b=binascii.a2b_uu(a)
>>> len(b)
>>> b==s

I.e., you can pass to a2b_uu ANY string (and ONLY such a string, not,
e.g., a slice or single char of it, as you're trying to do) that's a
result of a b2a_uu call; the length limitation applies only the other

I join /F in suggesting yo use binascii the standard way, but, at any
rate, you should at least redesign your decoding strategy so it only
calls a2b_uu on strings which are the results of b2a_uu calls.


More information about the Python-list mailing list