Aug-16-2017, 01:34 AM
Hello. I am trying to figure out why I keep getting this error where I try to change the directory (see code below)
OverflowError: mode out of range
But this for statement works if I put the same string defined as remotepath and then upload the files. The files were successfully uploaded using the remotepath and filename combination. Is there something I am missing below in the code that generates the error or is it an issue with the directory? I tried researching to see if there is a similar error out there, but could not find.
uploadlist=glob.glob('*.csv')
remotepath = '/data/PG'
for file in uploadlist:
dest.put(file,remotepath + file)
OverflowError: mode out of range
But this for statement works if I put the same string defined as remotepath and then upload the files. The files were successfully uploaded using the remotepath and filename combination. Is there something I am missing below in the code that generates the error or is it an issue with the directory? I tried researching to see if there is a similar error out there, but could not find.
uploadlist=glob.glob('*.csv')
remotepath = '/data/PG'
for file in uploadlist:
dest.put(file,remotepath + file)
dest = pysftp.Connection('server',username='user',password='password', cnopts=cnopts) loc=dest.chdir('data/PG') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Anaconda_Python\lib\site-packages\pysftp\__init__.py", line 524, in chdir self._sftp.chdir(remotepath) File "C:\Anaconda_Python\lib\site-packages\paramiko\sftp_client.py", line 615, in chdir if not stat.S_ISDIR(self.stat(path).st_mode): OverflowError: mode out of range