title: PermissionError: [WinError 5] when renaming files
body: <p>So I'm writing code in Python to go through your current directory, and replace all the files with a certain keyword with a different name.</p>
  
  <pre><code>import os
  
  os.chdir("D:\\")
  
  [os.rename(f, f.replace(r'sitka_weather_', 's_w_'))
      for f in os.listdir('.') if not f.startswith('.')]
  </code></pre>
  
  <p>So, it should replace <code>'sitka_weather_'</code> with <code>'s_w_'</code> in all files that contain <code>'sitka_weather_'</code>, right?</p>
  
  <p>But I get this error: <code>PermissionError: [WinError 5] Access is denied: '$RECYCLE.BIN' -&gt; '$RECYCLE.BIN'</code></p>
  
  <p>What does that mean? How do I fix it?</p>