In TftpStates.TftpStateSentRRQand TftpStates.TftpStateSentWRQ class when an ERR packet is received form server it should not send ERR packet to server again because server would have closed its session and RFC does not mention about it.
elif isinstance(pkt, TftpPacketERR):
self.sendError(TftpErrors.IllegalTftpOp)
log.debug("Received ERR packet: %s", pkt)
if pkt.errorcode == TftpErrors.FileNotFound:
raise TftpFileNotFoundError("File not found")
else:
raise TftpException("Received ERR from server: {}".format(pkt))
In
TftpStates.TftpStateSentRRQ
andTftpStates.TftpStateSentWRQ
class when an ERR packet is received form server it should not send ERR packet to server again because server would have closed its session and RFC does not mention about it.