Add an option handling UTF-8 decode errors in certain SSH packets
The SSH RFCs define that strings in some SSH packets must be encoded as UTF-8, and AsyncSSH enforces this by raising a ProtocolError when UTF-8 decoding fails. This commit adds a new config option to specify an error handling strategy for the following cases: * Disconnect reason * Debug message * Userauth banner * Channel open failure reason * Channel exit signal reason * SFTP error reason The default is 'strict', whch preserves the existing behavior of raising a ProtocolError, but selecting other options allows the invalid bytes to be removed or replaced, avoiding the exception. Thanks go to GitHub user Le-Syl21 for suggesting this!
R
Ron Frederick committed
254d73530ff93b6950f5debc19c675cd5ba8ad44
Parent: c7bc3aa