title: 'tuple' object has no attribute 'replace'
body: <p>I have gone through previous posts on this error. But, that does not help me. So I am putting for attention afresh. The code is as follows.</p>
  
  <pre><code>import os
  replacements = {':': '_', '+': '_'}
  
  for fn in os.walk('/media/ambijat/Dataworld/f23/Dropbox/ttgis'):
      nn = fn
      for k, v in replacements.items():
          nn = nn.replace(str(k), str(v))
          if nn != fn:
               os.rename(fn, nn)
  </code></pre>
  
  <p>This on running gives the error <code>'tuple' object has no attribute 'replace'</code> and seems to be giving error. I am using dict for replacement of special characters in filenames, eg., <code>[,&amp;&lt;&gt;*?|\";+:'() ]</code>. Is there any better way of doing this. thanks.</p>