title: Why does urllib.parse.quote encode non reserved characters in urls?
body: <p>The <code>parse</code> function in <code>urllib.parse</code> can be used to encode url components. But its behavior is different from the standard javascript encoder.</p>
  
  <p>In python</p>
  
  <pre><code>&gt;&gt;&gt; import urllib
  &gt;&gt;&gt; urllib.parse.quote('(a+b)')
  ... '%28a%2Bb%29'
  </code></pre>
  
  <p>in Javascript</p>
  
  <pre><code>&gt;&gt;&gt; encodeURIComponent('(a+b)')
  ... "(a%2Bb)"
  </code></pre>
  
  <p>Why is the python function more "strict" when encoding the url component?</p>
  
  <p>If I understood it right, brackets are not reserved characters in urls. So I don't understand why they are escaped in the urllib parse function.</p>