title: Escaping special characters in filepaths using SQLAlchemy
body: <p>I'm storing filenames and filepaths in MySQL.  Retrieving them from the database using <code>LIKE</code> expressions requires that I escape all allowed filename chars that collide with MySQL special chars.  I'm happy to simply use Python's <code>string.replace()</code> method, but was wondering if there was a more standard or built-in method of sanitizing filepaths with SQLAlchemy or dealing with filepaths in MySQL in general.</p>
  <p>I need the solution to be OS-agnostic and established.  It does not need to be implemented in SA.  I'll accept any procedure for encoding that works; failing that, I need a list of all chars that need to be escaped and a smart choice of an escape char.</p>