Changeset 45


Ignore:
Timestamp:
04/11/13 17:05:59 (11 years ago)
Author:
tmorgan
Message:

percent encoder fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/bletchley/blobtools.py

    r44 r45  
    3636        fmt = "%%%.2x"
    3737
    38     ret_val = b''
     38    ret_val = bytearray(b'')
    3939    for c in binary:
    4040        if c not in b'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789':
    41             ret_val += (fmt % c).encode('ascii')
     41            ret_val.extend((fmt % c).encode('ascii'))
    4242        elif plus and (c == 20):
    43             ret_val += b'+'
     43            ret_val.extend(b'+')
    4444        else:
    45             ret_val += c
     45            ret_val.append(c)
    4646   
    4747    return ret_val
Note: See TracChangeset for help on using the changeset viewer.