title: Python shutil.copy fails on FAT file systems (Ubuntu)
body: <p>Problem: Using shutil.copy() to copy a file to a FAT16 mounted filesystem in Linux fails (Python 2.7.x). The failure is shutil internal error and failing actually on shutil.chmod, which shutil.copy seems to execute. </p>
  
  <p>Shell chmod fails, too, as permissions are not supported in FAT. </p>
  
  <p>Questions: Is there any neat way around this? I know I have several options, for example:</p>
  
  <ol>
  <li>Use copyfile - not ideal as it requires full path, not just target directory, but doable</li>
  <li>Execute shell cp to copy files</li>
  <li>Write own copy function that doesn't try to change file modes</li>
  </ol>
  
  <p>Is there a way around this in Python OR in FAT mount options? I now mount the filesystem inside my program by executing mount -t vfat -o umask=000 /dev/loop0 /mnt/foo</p>
  
  <p>Catching the exception doesn't help, as the exception happens inside shutil.copy and shutil.copy() seems to delete the target file when it catches IOException from shutil.chmod(), before passing IOException to the calling function.</p>
  
  <p>Any ideas, or should I just choose one from 1-3?</p>
  
  <p>Hannu</p>