title: Getting Error (PermissionError: [WinError 5] Access is denied) when Execute below code
body: <pre><code>import boto3
  
  _BUCKET_NAME = 'Bucket_Name'
  _PREFIX = 'data/'
  
  ACCESS_KEY='*********************'
  SECRET_KEY='**************************'
  
  client = boto3.client('s3', aws_access_key_id=ACCESS_KEY,
                              aws_secret_access_key=SECRET_KEY)
  
  def ListFiles(client):
      """List files in specific S3 URL"""
      response = client.list_objects(Bucket=_BUCKET_NAME, Prefix=_PREFIX)
      for content in response.get('Contents', []):
          yield content.get('Key')
  
  file_list = ListFiles(client)
  for file in file_list:
  client.download_file('Bucket_Name',file,'C:/Users/UserName/Desktop/folder/')
  </code></pre>
  
  <blockquote>
    <p>Traceback (most recent call last):</p>
    
    <p>File "", line 21, in 
        client.download_file('Bucket_Name',file,'C:/Users/User/Desktop/folder')</p>
    
    <p>File
    "C:\ProgramData\Anaconda3\lib\site-packages\boto3\s3\inject.py", line
    172, in download_file
        extra_args=ExtraArgs, callback=Callback)</p>
    
    <p>File
    "C:\ProgramData\Anaconda3\lib\site-packages\boto3\s3\transfer.py",
    line 307, in download_file
        future.result()</p>
    
    <p>File
    "C:\ProgramData\Anaconda3\lib\site-packages\s3transfer\futures.py",
    line 106, in result
        return self._coordinator.result()</p>
    
    <p>File
    "C:\ProgramData\Anaconda3\lib\site-packages\s3transfer\futures.py",
    line 265, in result
        raise self._exception</p>
    
    <p>File
    "C:\ProgramData\Anaconda3\lib\site-packages\s3transfer\tasks.py", line
    126, in <strong>call</strong>
        return self._execute_main(kwargs)</p>
    
    <p>File
    "C:\ProgramData\Anaconda3\lib\site-packages\s3transfer\tasks.py", line
    150, in _execute_main
        return_value = self._main(**kwargs)</p>
    
    <p>File
    "C:\ProgramData\Anaconda3\lib\site-packages\s3transfer\download.py",
    line 603, in _main
        osutil.rename_file(fileobj.name, final_filename)</p>
    
    <p>File
    "C:\ProgramData\Anaconda3\lib\site-packages\s3transfer\utils.py", line
    271, in rename_file
        rename_file(current_filename, new_filename)</p>
    
    <p>File
    "C:\ProgramData\Anaconda3\lib\site-packages\s3transfer\compat.py",
    line 25, in rename_file
        os.remove(new_filename)</p>
    
    <p>PermissionError: [WinError 5] Access is denied:
    'C:/Users/User/Desktop/folder'</p>
  </blockquote>