Can I disable paramiko sftp client stat check w/o touching source code ?
I am using the sftp client in Paramiko 1.7.3 for EDI to remote sites (to push files out). On quite a few of the remote sites, it is not possible to check the status of the sent file due to restrictions (file cannot be stat'd, or file is taken away upon arrival). Thus using the put method generates a file not found error.
I currently have to edit out the remote file size checking code in the put method of the sftp_client class sftp_client.py. The code I comment out is:
<cut>
s = self.stat(
if s.st_size != size:
raise IOError('size mismatch in put! %d != %d' % (s.st_size, size))
<cut>
at the end of the method.
I am wondering if there is a better way of going about this then editing the code (which is not really desirable since any upgrade or patches of paramiko would have to keep this in mind).
I could use the the OS's sftp with pyexpect, but since I have already invested time in paramiko for other purposes as well, I want to continue using it. Any suggestions would be much appreciated.
thanks,
kyaw than
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- paramiko Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jonathan Marsden
- Solved:
- Last query:
- Last reply: