scp.py icon indicating copy to clipboard operation
scp.py copied to clipboard

File not closed in case SocketTimeout occured

Open jarzen09 opened this issue 3 years ago • 0 comments

In function _recv_file(self, cmd) file where received data is stored is opened (file_hdl), but it is closed only in case whole data is transmitted properly. In case transmission is failed the file is kept open and prevents from reattempt. For example in case SocketTimeout occurred, following error is seen during reattempt: [WinError 32] The process cannot access the file because it is being used by another process:

File handler file_hdl should be closed also in case exceptions SCPException are raised in that function.

jarzen09 avatar Jul 25 '22 15:07 jarzen09