title: Issue with "ValueError: Single '}' encountered in format string" in an API Call
body: <p>I'm using Python 3 for this.</p>
  
  <p>Basically, I'm making a API call using urllib and getting the error:</p>
  
  <p><em>"ValueError: Single '}' encountered in format string"</em> </p>
  
  <p>I have looked at a variety of other solutions but they don't seem to work.</p>
  
  <p>Basically what I am doing is:</p>
  
  <pre><code>import urllib.request
  import urllib.parse
  
  def query_person(first, last):
     person_request = urllib.request.urlopen('http://api.querysite.com/content/search/index:AUTHOR?query=authlast%28%27{last}}%27%29%20AND%20authfirst%28%27{first}}%27%29&amp;'.format(first=first,last=last))
     return(person_request)
  
  print(query_person("John", "Doe"))
  </code></pre>
  
  <p>The actual API will not be reproducible since it requires an API key (ommited obviously) as well as the need to be on a verified network.</p>
  
  <p>I think the issue has to do with <strong>"{last}}%27%29%20AND%20authfirst%28%27{first}}"</strong> having an extra bracket.  For example, if I wanted to just query it in my url bar without python or .format(), it would look like:</p>
  
  <pre><code>http://api.querysite.com/content/search/index:AUTHOR?query=authlast%28%27Doe}%27%29%20AND%20authfirst%28%27John}%27%29&amp;
  </code></pre>
  
  <p>or more specifically: <strong>Doe}%27%29%20AND%20authfirst%28%27John}%27%29&amp;</strong></p>
  
  <p>If I use the latter method in python, I have no issues, but it does not allow me to input names to query of course. </p>