title: Escape space in filepath
body: <p>I'm trying to write a python tool that will read a logfile and process it</p>
  
  <p>One thing it should do is use the paths listed in the logfile (it's a logfile for a backup tool)</p>
  
  <pre><code>/Volumes/Live_Jobs/Live_Jobs/*SCANS\ and\ LE\ Docs/_LE_PROOFS_DOCS/JEM_lj/JEM/0002_OXO_CorkScrew/3\ Delivery/GG_Double\ Lever\ Waiters\ Corkscrew_072613_Mike_RETOUCHED/gg_3110200_2_V3_Final.tif
  </code></pre>
  
  <p>Unfortunately the paths that I'm provided with aren't appropriately escaped and I've had trouble properly escaping in python. Perhaps python isn't the best tool for this, but I like it's flexibility - it will allow me to extend whatever I write</p>
  
  <p>Using the regex escape function escapes too many characters, pipes.quote method doesn't escape the spaces, and if I use a regex to replace ' ' with '\ ' I end up getting</p>
  
  <pre><code>/Volumes/Live_Jobs/Live_Jobs/*SCANS\\ and\\ LE\\ Docs/_LE_PROOFS_DOCS/JEM_lj/JEM/0002_OXO_CorkScrew/3\\ Delivery/GG_Double\\ Lever\\ Waiters\\ Corkscrew_072613_Mike_RETOUCHED/gg_3110200_2_V3_Final.tif
  </code></pre>
  
  <p>which are double escaped and wont pass to python functions like <code>os.path.getsize()</code>. </p>
  
  <p>What am I doing wrong??</p>