Here the pseudo code about the flow:
from array import array c = array('b') with open(file, mode = 'rb') as f: for character in f: res = func(character) c.append(res)
It runs into the error:
OverflowError: signed char is greater than maximum
with a special character ‘À’ which its binary value is 192
My way to resolve this error is to update typecode of the array from ‘b’ (signed char) to ‘B’ (unsigned char).
from array import array c = array('B')
Reason: Data from the file should not in a range which from -127 to -1.