Hi,
I am encoding a string such as...
....I then try to decode this by...
this seems to work sometimes....fo r example a list which has a short
string in it like ["this is a test"]
however if the list of data going into the decode function contains a
bunch of elements I get the following error...
result.append(b inascii.a2b_uu( val))
binascii.Error: Trailing garbage
...any idea why this is happening? Anyone successfully use the uu to
encode/decode strings of varying length (even larger strings, more than
a few hundred characters)?
I am encoding a string such as...
Code:
data = someFile.readlines() encoded = [] for line in data: encoded.append(binascii.b2a_uu(stringToEncode)) return encoded
Code:
def decode(data): result = [] for val in data: result.append(binascii.a2b_uu(val)) return result
string in it like ["this is a test"]
however if the list of data going into the decode function contains a
bunch of elements I get the following error...
result.append(b inascii.a2b_uu( val))
binascii.Error: Trailing garbage
...any idea why this is happening? Anyone successfully use the uu to
encode/decode strings of varying length (even larger strings, more than
a few hundred characters)?
Comment