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


Groups > comp.lang.python > #82150

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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Nobody <nobody@nowhere.invalid>
Newsgroups comp.lang.python
Subject Re: why can't download file from linux server into local window disk c:?
Date Mon, 08 Dec 2014 22:25:05 +0000
Organization A noiseless patient Spider
Lines 21
Message-ID <pan.2014.12.08.22.25.03.434000@nowhere.invalid> (permalink)
References <mailman.16725.1418055279.18130.python-list@python.org>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Injection-Info mx02.eternal-september.org; posting-host="152d4dee6f95183c956ee6fa63d7e69f"; logging-data="32725"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+iZ+gx9rhbL/Omi7JyQ9F/"
User-Agent Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Cancel-Lock sha1:NN5lAdOhXSxpUO9+EFuu4yk6Vr8=
Xref csiph.com comp.lang.python:82150

Show key headers only | View raw


On Tue, 09 Dec 2014 00:14:15 -0800, pengsir wrote:

> localpath = 'c:'
> sftp.get(filepath, localpath)

>      with open(localpath, 'wb') as fl:
> PermissionError: [Errno 13] Permission denied: 'c:'

It's trying to open "c:", which is a drive, as if it was a file.

You have to specify the destination filename, not just the directory.

Also, you probably shouldn't be trying to write to the root directory of
the C drive. You should probably be using a directory beneath either
%USERPROFILE% or %ALLUSERSPROFILE%.

Writing to the root of the system drive tends to require Administrator
privileges. Even if the current user is an administrator, the process must
have elevated privilege (e.g. via "Run as Administrator" or an explicit
privilege-elevation request from within the code).

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


Thread

why can't download file from linux server into local window disk c:? pengsir <elearn2014@gmail.com> - 2014-12-09 00:14 -0800
  Re: why can't download file from linux server into local window disk c:? Luuk <luuk@invalid.lan> - 2014-12-08 17:37 +0100
  Re: why can't download file from linux server into local window disk c:? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2014-12-08 20:36 +0100
  Re: why can't download file from linux server into local window disk c:? Nobody <nobody@nowhere.invalid> - 2014-12-08 22:25 +0000

csiph-web