perf: utf-8编码忽略报错

pull/8845/head
halo 2 years ago committed by Jiangjie.Bai
parent 984b94c874
commit 56c324b04e

@ -13,7 +13,7 @@ def telnet(dest_addr, port_number=23, timeout=10):
return False, str(e) return False, str(e)
expected_regexes = [bytes(PROMPT_REGEX, encoding='ascii')] expected_regexes = [bytes(PROMPT_REGEX, encoding='ascii')]
index, prompt_regex, output = connection.expect(expected_regexes, timeout=3) index, prompt_regex, output = connection.expect(expected_regexes, timeout=3)
return True, output.decode('utf-8') return True, output.decode('utf-8', 'ignore')
if __name__ == "__main__": if __name__ == "__main__":

Loading…
Cancel
Save