You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Read Until With Encoding Errors On Strict test is failing with UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfa in position 88: invalid start byte (the "position" can differ). Turns out that the corrupted output of the file is leaking to the Write keyword call. It makes Write fail depending on timing, if the output following Write is corrupted. Issue introduced in #431
def_read_until(self, matcher, expected, timeout=None):
timeout=TimeEntry(timeout) iftimeoutelseself.config.get('timeout')
max_time=time.time() +timeout.valuewhiletime.time() <max_time:
undecoded=self._single_complete_read_to_buffer(max_time) # <<<<< Reading into corrupted textifundecoded:
self._receive_buffer+=undecoded.decode( # <<<<< Exceptionself.config.encoding, "ignore"
)
match=matcher(self._receive_buffer)
ifmatch:
ifhasattr(match, "end"):
end=match.end()
else:
end=self._receive_buffer.index(expected) +len(expected)
output=self._receive_buffer[0:end]
self._receive_buffer=self._receive_buffer[end:]
returnoutputoutput=self._receive_bufferself._receive_buffer=""raiseSSHClientException(f"No match found for '{expected}' in {timeout}\nOutput:\n{output}.")
If the read after Write reads beyond the written text into the corrupted part, the
will read until timeout and the undecoded.decode will fail. The fix might be to try and decode as much of the beginning of the undecoded part as possible and then match.
The text was updated successfully, but these errors were encountered:
The Read Until With Encoding Errors On Strict test is failing with
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfa in position 88: invalid start byte
(the "position" can differ). Turns out that the corrupted output of the file is leaking to the Write keyword call. It makes Write fail depending on timing, if the output following Write is corrupted. Issue introduced in #431If the read after Write reads beyond the written text into the corrupted part, the
undecoded = self._single_complete_read_to_buffer(max_time)
will read until timeout and the
undecoded.decode
will fail. The fix might be to try and decode as much of the beginning of the undecoded part as possible and then match.The text was updated successfully, but these errors were encountered: