def ascii_encode_dict(data):
    ascii_encode = lambda x: x.encode('ascii') if isinstance(x, str) else x
return dict(map(ascii_encode, pair) for pair in list(data.items()))
Forcing Python json module to work with ASCII