Changeset 44


Ignore:
Timestamp:
04/11/13 16:55:05 (11 years ago)
Author:
tmorgan
Message:

fixes for percent decoder

File:
1 edited

Legend:

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

    r42 r44  
    2121import base64
    2222import binascii
     23import traceback
    2324import fractions
    2425import operator
     
    4849
    4950def _percentDecode(binary, plus=False):
    50     ret_val = b''
    5151    if plus:
    5252        binary = binary.replace(b'+', b' ')
     
    5454        return b''
    5555    chunks = binary.split(b'%')
    56     if binary[0] == 0x25:
    57         chunks = chunks[1:]
    58 
    59     for chunk in chunks:
     56
     57    ret_val = chunks[0]
     58    for chunk in chunks[1:]:
    6059        if len(chunk) < 2:
    6160            return None
     
    6362            ret_val += bytes([int(chunk[0:2], 16)]) + chunk[2:]
    6463        except:
    65             print(repr(chunk))
     64            #traceback.print_exc()
     65            #print(repr(chunk), repr(binary))
    6666            return None
    6767           
Note: See TracChangeset for help on using the changeset viewer.