Python Forum
python 2.7 access denied when writing a file to Windows
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python 2.7 access denied when writing a file to Windows
#1
Hello,

I'm trying to use a python script to download a file from s3 to my Windows 10 laptop. I'm running the
prompt "as administrator". I have given everyone full access to the folder I'm trying to write the file
to, but windows is still giving an "access denied" error.

import boto3
s3 = boto3.resource('s3')
s3.Bucket('kapps2.services-exchange.com').download_file('myconfig.py', 'C:\data')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\boto3\s3\inject.py", line 168, in bucket_download_file
ExtraArgs=ExtraArgs, Callback=Callback, Config=Config)
File "C:\Python27\lib\site-packages\boto3\s3\inject.py", line 130, in download_file
extra_args=ExtraArgs, callback=Callback)
File "C:\Python27\lib\site-packages\boto3\s3\transfer.py", line 307, in download_file
future.result()
File "C:\Python27\lib\site-packages\s3transfer\futures.py", line 73, in result
return self._coordinator.result()
File "C:\Python27\lib\site-packages\s3transfer\futures.py", line 233, in result
raise self._exception
WindowsError: [Error 5] Access is denied: 'C:\\data'

I'm new to Python, can anyone help with this? Thank You
Reply
#2
It's not python.
That error is generated from OS.
Say right there WindowsError
Reply
#3
SOLVED - I needed to include the file name in the path, it was not good enough to just have the file name and the path.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  The INSERT permission was denied on the object Steven5055 2 1,491 Feb-25-2023, 11:37 PM
Last Post: Steven5055
  Trying to access excel file on our sharepoint server but getting errors cubangt 0 820 Feb-16-2023, 08:11 PM
Last Post: cubangt
  data file for .exe program to access ose 2 1,194 Nov-23-2022, 08:02 PM
Last Post: snippsat
  Writing string to file results in one character per line RB76SFJPsJJDu3bMnwYM 4 1,386 Sep-27-2022, 01:38 PM
Last Post: buran
  access is denied error 5 for network drive mapping ? ahmedbarbary 2 1,816 Aug-17-2022, 10:09 PM
Last Post: ahmedbarbary
  Writing to json file ebolisa 1 1,012 Jul-17-2022, 04:51 PM
Last Post: deanhystad
  Server Folder Error : WinError5 Access Denied fioranosnake 1 1,131 Jun-21-2022, 11:11 PM
Last Post: Larz60+
  Writing to External File DaveG 9 2,500 Mar-30-2022, 06:25 AM
Last Post: bowlofred
  batch file for running python scipt in Windows shell MaartenRo 2 1,899 Jan-21-2022, 02:36 PM
Last Post: MaartenRo
  Error no 13: Permission denied in python shantanu97 1 6,185 Mar-31-2021, 02:15 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020