You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In fabric 2.0.1 connection.get() fails in windows with PermissionError: [Errno 13] Permission denied: when trying to copy to a custom local path.
#1782
Closed
nagavnaga opened this issue
May 29, 2018
· 2 comments
with Connection(host) as cxn: cxn.run(cmd) local_path = r'C:\Program Files\JetBrains\my codes\fabric framework\fabric2.0\SG_info' cxn.get(filename, local_path)
Same is working fine when i leave the local path to default
or
Set the local path by changing the cwd() like below and leave the local path to default.
Full trace is below
"C:/Program Files/JetBrains/my codes/fabric framework/fabric2.0/just1.py"
Traceback (most recent call last):
File "C:/Program Files/JetBrains/my codes/fabric framework/fabric2.0/just1.py", line 14, in
cxn.get('sym.txt', local_path)
File "C:\Users\venkan5\AppData\Local\Programs\Python\Python36-32\lib\site-packages\fabric\connection.py", line 628, in get
return Transfer(self).get(*args, **kwargs)
File "C:\Users\venkan5\AppData\Local\Programs\Python\Python36-32\lib\site-packages\fabric\transfer.py", line 112, in get
sftp.get(remotepath=remote, localpath=local)
File "C:\Users\venkan5\AppData\Local\Programs\Python\Python36-32\lib\site-packages\paramiko\sftp_client.py", line 769, in get
with open(localpath, 'wb') as fl:
PermissionError: [Errno 13] Permission denied: 'C:\Program Files\JetBrains\my codes'
The text was updated successfully, but these errors were encountered:
I've been getting a similar issue with 2.2.1 too. As it turns out, the sftp server and ssh server of the same machine don't always display the same directory structures. I was getting permission denied or file not found because I was stuck in a different root folder. Unfortunately I found that this is not always the case, as one of my servers does have the same sftp and ssh directory structures.
I found that working directly with connection.sftp(), connection.command_cwds, and opening local files as bytes solves my problems.
with Connection(host) as cxn: cxn.run(cmd) local_path = r'C:\Program Files\JetBrains\my codes\fabric framework\fabric2.0\SG_info' cxn.get(filename, local_path)
Same is working fine when i leave the local path to default
or
Set the local path by changing the cwd() like below and leave the local path to default.
os.chdir(r'C:\Program Files\JetBrains\my codes\fabric framework\fabric2.0\SG_info')
Full trace is below
"C:/Program Files/JetBrains/my codes/fabric framework/fabric2.0/just1.py"
Traceback (most recent call last):
File "C:/Program Files/JetBrains/my codes/fabric framework/fabric2.0/just1.py", line 14, in
cxn.get('sym.txt', local_path)
File "C:\Users\venkan5\AppData\Local\Programs\Python\Python36-32\lib\site-packages\fabric\connection.py", line 628, in get
return Transfer(self).get(*args, **kwargs)
File "C:\Users\venkan5\AppData\Local\Programs\Python\Python36-32\lib\site-packages\fabric\transfer.py", line 112, in get
sftp.get(remotepath=remote, localpath=local)
File "C:\Users\venkan5\AppData\Local\Programs\Python\Python36-32\lib\site-packages\paramiko\sftp_client.py", line 769, in get
with open(localpath, 'wb') as fl:
PermissionError: [Errno 13] Permission denied: 'C:\Program Files\JetBrains\my codes'
The text was updated successfully, but these errors were encountered: