This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Pysftp Issue File Upload is not working - put command
Type: Stage: resolved
Components: Tests Versions: Python 3.7
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: Sandeep, eric.smith
Priority: normal Keywords:

Created on 2020-03-11 00:07 by Sandeep, last changed 2022-04-11 14:59 by admin. This issue is now closed.

File name Uploaded Description Edit Sandeep, 2020-03-11 00:07 This is the file which I am using
Messages (4)
msg363870 - (view) Author: Sandeep (Sandeep) * Date: 2020-03-11 00:07
   We have requirement where we need to get file from client path and then upload the same to vendor directory path. I am not able to upload the file to vendor directory path , however when I tried to use the WINSCP it worked fine. So I thought of checking with Gurus what is wrong I am doing in my script. Appreciate your input.
I will attach my script. Here is what I am doing.

Step1. Clear the client directory path
Step2. Make a call to HVAC Vault to get the username and password for client and vendor server
Step3. Use the username and password to establish connection using pysftp for client. 
Step4. Store the file in local path.
Step5. Segregate the file into different path based on file type
Step6  Establish a connection to vendor and copy the file to vendor.
Step7  Close the client and Vendor connection

Please see the file attached.

Also below is the error which I am getting

ERROR:root:Error in getting the file from EBS Outbound Server
Traceback (most recent call last):
  File "", line 191, in file_transfer
    vendor.put(src_file, dst_file)
  File "/d01/python3/lib64/python3.6/site-packages/pysftp/", line 364, in put
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/", line 759, in put
    return self.putfo(fl, remotepath, file_size, callback, confirm)
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/", line 720, in putfo
    s = self.stat(remotepath)
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/", line 493, in stat
    t, msg = self._request(CMD_STAT, path)
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/", line 813, in _request
    return self._read_response(num)
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/", line 865, in _read_response
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/", line 894, in _convert_status
    raise IOError(errno.ENOENT, text)
FileNotFoundError: [Errno 2] /custom/OWO/ECE_OWO_20200303_143895.dat
msg363873 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2020-03-11 01:04
This is the python bug tracker. What you are reporting is almost certainly not a bug in python. If you think it is a bug in python, please reproduce it in the smallest possible code fragment, and with no third party libraries installed.

If you're seeking general help, you might try the python-list mailing list. If you think this is a bug in paramiko or pysftp, you should report it to their respective bug trackers.
msg363874 - (view) Author: Sandeep (Sandeep) * Date: 2020-03-11 01:06
Eric how can I contact the python Mailing list
msg363875 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2020-03-11 01:07
Hi, Sandeep. For information see
Date User Action Args
2022-04-11 14:59:28adminsetgithub: 84109
2020-03-11 05:43:50steven.dapranosetstatus: open -> closed
resolution: third party
stage: resolved
2020-03-11 01:07:54eric.smithsetmessages: + msg363875
2020-03-11 01:06:58Sandeepsetstatus: pending -> open

messages: + msg363874
2020-03-11 01:04:58eric.smithsetstatus: open -> pending

nosy: + eric.smith
messages: + msg363873

type: crash ->
2020-03-11 00:07:35Sandeepcreate