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
  Problems writing a large text file in python Vilius 4 1,006 Dec-21-2024, 09:20 AM
Last Post: Pedroski55
  Can a windows file be 'remapped' in Linux ? jehoshua 3 873 Dec-07-2024, 03:33 AM
Last Post: jehoshua
  How to re-register .py file extension to new moved Python dir (on Windows)? pstein 5 1,309 Nov-06-2024, 03:06 PM
Last Post: DeaD_EyE
  sharepoint: Access has been blocked by Conditional Access policies CAD79 0 2,171 Jul-12-2024, 09:36 AM
Last Post: CAD79
  Executable file compiled by PyInstaller does not work on Windows 7 amusaber 1 1,772 Jul-11-2024, 02:59 PM
Last Post: DeaD_EyE
  writing list to csv file problem jacksfrustration 5 2,346 Jul-04-2024, 08:15 PM
Last Post: deanhystad
  Circumvent the "access denied" page? Pedroski55 7 2,190 Jun-15-2024, 06:25 AM
Last Post: Pedroski55
  The INSERT permission was denied on the object Steven5055 3 2,964 Jun-12-2024, 08:13 AM
Last Post: GregoryConley
  Trying to access excel file on our sharepoint server but getting errors cubangt 0 1,475 Feb-16-2023, 08:11 PM
Last Post: cubangt
  data file for .exe program to access ose 2 2,263 Nov-23-2022, 08:02 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