title: Encode file path properly using python
body: <p>I am trying to open files by getting the path from a dictionary. Some of the file names have commas (,) and other such characters which when used give a "no such file found error"</p>
  
  <p>For instance the following file path will not open: <code>foo,%20bar.mp3</code></p>
  
  <p>If characters like commas exist then it should be encoded as : <code>foo%2C%20bar.mp3</code></p>
  
  <p>Can anyone tell me how to do this?</p>