title: Python shutil.copy Permission Error Windows
body: <p>I know this question is asked and answered many places on this site but none of the resolutions work for me.  Basically, I need shutil.copy to work the same way as shutil.move works (and it does) but when I do .copy I get the Error 13 Permissions error on the source file.</p>
  <p>I can't do shutil.copytree because I need not the content of the first file folder to be copied but the file folder itself (with the contents inside).  I've tried checking the permissions, modifying, nothing works.</p>
  <p>I've also tried using the full path including the folder names (no variables) and I still get the same error.</p>
  <p>This is in Windows 7 and 8.1</p>
  <p>Here is the code:</p>
  <pre><code>import os
  import csv
  import re
  from os import path
  from distutils.dir_util import copy_tree
  import shutil
  
  
  # Open the csv file
  f = open(&quot;Consumers.csv&quot;)
  csv_f = csv.reader(f)
  
  
  #Loop throught the csv file
  for eachrow in csv_f:
     
      #loop through the folders in the directory
       for foldname in os.listdir():
  
          #If the folder name is the same as a field in the first column of the csv file 
              if (foldname == eachrow[0]):
                  
                  #Name the second column filed name &quot;bucket.&quot;  
                  #This is also the name of a folder in the same directory
                  bucket = eachrow[1]
                  
                  #copy the first folder (and contents) into the second folder
                  shutil.copy (foldname, bucket)
              
  </code></pre>
  <p>And the error:</p>
  <hr />
  <pre><code>PermissionError                           Traceback (most recent call last)
  &lt;ipython-input-36-61e009418603&gt; in &lt;module&gt;
       25 
       26                 #copy the first folder (and contents) into the second folder
  ---&gt; 27                 shutil.copy (foldname, bucket)
       28 
       29 
  
  ~\Anaconda3\lib\shutil.py in copy(src, dst, follow_symlinks)
      243     if os.path.isdir(dst):
      244         dst = os.path.join(dst, os.path.basename(src))
  --&gt; 245     copyfile(src, dst, follow_symlinks=follow_symlinks)
      246     copymode(src, dst, follow_symlinks=follow_symlinks)
      247     return dst
  
  ~\Anaconda3\lib\shutil.py in copyfile(src, dst, follow_symlinks)
      118         os.symlink(os.readlink(src), dst)
      119     else:
  --&gt; 120         with open(src, 'rb') as fsrc:
      121             with open(dst, 'wb') as fdst:
      122                 copyfileobj(fsrc, fdst)
  
  PermissionError: [Errno 13] Permission denied: 'Last1_First1_11111'
  </code></pre>
  <hr />
  <p>Any help would be greatly appreciated!</p>