The exception even tells you that "chr() arg not in range(0x110000)" which has nothing to do with range of C's character types.