import binascii all_functions = [ 'a2b_base64', 'b2a_base64', 'a2b_hex', 'b2a_hex', 'a2b_hqx', 'b2a_hqx', 'a2b_qp', 'b2a_qp', 'a2b_uu', 'b2a_uu', 'crc32', 'crc_hqx', 'hexlify', 'unhexlify', 'rlecode_hqx', 'rledecode_hqx', ] SAMPLE = 'abcd' for func in all_functions: f = getattr(binascii, func) try: if func == 'crc_hqx': r = f(SAMPLE, 0) else: r = f(SAMPLE) print(func) except Exception as e: print(func, repr(e), sep='\t') ### Output # a2b_base64 TypeError('must be bytes or buffer, not str',) # b2a_base64 TypeError('must be bytes or buffer, not str',) # a2b_hex # b2a_hex TypeError('must be bytes or buffer, not str',) # a2b_hqx TypeError('must be bytes or read-only character buffer, not str',) # b2a_hqx TypeError('must be bytes or buffer, not str',) # a2b_qp # b2a_qp TypeError('argument 1 must be bytes or buffer, not str',) # a2b_uu TypeError('must be bytes or buffer, not str',) # b2a_uu TypeError('must be bytes or buffer, not str',) # crc32 TypeError('must be bytes or buffer, not str',) # crc_hqx TypeError('must be bytes or buffer, not str',) # hexlify TypeError('must be bytes or buffer, not str',) # unhexlify # rlecode_hqx TypeError('must be bytes or buffer, not str',) # rledecode_hqx