Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82214

Re: why can't download file from linux server into local window disk c:

Path csiph.com!usenet.pasdenom.info!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.alt.net!news.astraweb.com!border5.newsrouter.astraweb.com!not-for-mail
From "MRAB" <mrab@1:249/999.remove-cdt-this>
To pengsir
Subject Re: why can't download file from linux server into local window disk c:
Message-ID <54866F2E.1752.complang@piz.noip.com> (permalink)
X-Comment-To pengsir
Newsgroups comp.lang.python
X-FTN-AREA COMP.LANG.PYTHON
X-FTN-PID SoupGate-Win32 v1.05
X-FTN-MSGID <mailman.16729.1418063502.18130.python-list@python.org> df8735ee
X-FTN-REPLY <5486AF57.7070803@gmail.com> 58750c9b
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway piz.noip.com [Synchronet 3.15b-Win32 NewsLink 1.92]
X-Server piz.noip.me
Date 9 Dec 2014 11:32:00 -0500
Lines 35
Organization Unlimited download news at news.astraweb.com
NNTP-Posting-Host 2266ad8f.news.astraweb.com
X-Trace DXC=LP`[=a9Aa>EWe7Bc]TQV_NL?0kYOcDh@JRScV177L_PAZh[e@ZS;QSCl23]GVn`ZmFMHo6fPSBkUK04hIVDTD?[K7g\XjYcGehIfPiGS6_2a\M
Xref csiph.com comp.lang.python:82214

Show key headers only | View raw


  To: pengsir
On 2014-12-09 08:14, pengsir wrote:
>
>
> My vps ip is x.y.z.w ,i want to download /etc/passwd from linux server
> into my local window disk c: .
>
> import paramiko
> host = "x.y.z.w"
> port = 22
> transport = paramiko.Transport((host, port))
> password = "mykey"
> username = "root"
> transport.connect(username = username, password = password)
> sftp = paramiko.SFTPClient.from_transport(transport)
> filepath = '/etc/passwd'
> localpath = 'c:'
> sftp.get(filepath, localpath)
>
> Traceback (most recent call last):
>     File "<stdin>", line 1, in <module>
>     File "D:\Python34\lib\site-packages\paramiko\sftp_client.py", line
> 719, in get
>
>       with open(localpath, 'wb') as fl:
> PermissionError: [Errno 13] Permission denied: 'c:'
>
It's trying to open the file 'c:', but that's not a file, it's a folder.

Try, say, 'c:/passwd' instead.

--- SoupGate-Win32 v1.05
 * Origin: <SpaceSST.BBS.Fidonet<>NNTP.gateway.@.piz.noip.me> (1:249/999)
--- Synchronet 3.15b-Win32 NewsLink 1.92
SpaceSST BBS Usenet <> Fidonet Gateway

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: why can't download file from linux server into local window disk c: "MRAB" <mrab@1:249/999.remove-cdt-this> - 2014-12-09 11:32 -0500

csiph-web