title: Shutil.copy causes file data deletion
body: <p>I am using shutil.copy to copy the content of one file to another. However it is causing my orignal files to be deleted with the error of "no data in file"</p>
  
  <p>I first tried this</p>
  
  <pre><code>    import shutil
      shutil.copy('keywords.txt', 'keywordsfinal.txt')
  </code></pre>
  
  <p>Then was told the files need to be open and in a writable format</p>
  
  <pre><code>    import shutil
      ab = open("keywords.txt","w")
      abc = open("keywordsfinal.txt","w")
      shutil.copy('keywords.txt', 'keywordsfinal.txt')
      ab.close()
      abc.close()
  </code></pre>
  
  <p>However with both code, even if I have something in each .txt file, for instance test1, and test2, both files will return empty. </p>
  
  <p>I had this working before and returned to my program about 6 months later to find this error. Any help appreciated. </p>
  
  <p>Recently however the below error also started to appear, I have no idea what it is and if it is with any relevance to my code.</p>
  
  <pre><code> Traceback (most recent call last):
     File "C:\Python33\lib\random.py", line 249, in choice
       i = self._randbelow(len(seq))
     File "C:\Python33\lib\random.py", line 225, in _randbelow
       r = getrandbits(k)          # 0 &lt;= r &lt; 2**k
   ValueError: number of bits must be greater than zero
  
   During handling of the above exception, another exception occurred:
  
   Traceback (most recent call last):
     File "C:\Users\*******\Desktop\*******\*********Python\new\Final - Copy.py", line      84, in &lt;module&gt;
       a = random.choice(list(f)).strip() #.strip cleans the line \n problem
     File "C:\Python33\lib\random.py", line 251, in choice
       raise IndexError('Cannot choose from an empty sequence')
   IndexError: Cannot choose from an empty sequence
  </code></pre>