except TftpFileNotFoundError as err:
# If we received file not found, then we should not save the open
# output file or we'll be left with a size zero file. Delete it,
# if it exists.
log.error("Received File not found error")
if self.fileobj is not None and not self.filelike_fileobj:
if os.path.exists(self.fileobj.name):
log.debug("unlinking output file of %s", self.fileobj.name)
os.unlink(self.fileobj.name)
raise
When downloading a file that not exists on TFTP-Server. The local file object has been opened in init(), but not closed yet here. So, when calling os.unlink(), it will raise another exception 'PermissionError'.
Please confirm and fix it. Thanks very much.
When downloading a file that not exists on TFTP-Server. The local file object has been opened in init(), but not closed yet here. So, when calling os.unlink(), it will raise another exception 'PermissionError'. Please confirm and fix it. Thanks very much.