 <p>The following worked to fix the issue:</p> <pre><code>url = urllib.unquote(str(res.url)).decode('utf-8', 'ignore') </code></pre> <p><code>res.url</code> was a unicode string, but didn't seem to work well with <code>urllib.unquote</code>. So the solution was to first convert it to a string (like how it was in the python interpreter) and then <code>decode</code> it into Unicode.</p>