title: How to do multi-part upload with Python requests library AND unicode filename?
body: <p>I'm trying to upload a file to JIRA using its REST API. Uploads are done as multi-part POST. The code works fine so long as the filenames are ASCII. If they contain any non-ASCII characters, JIRA gives a 500 error.</p>
  
  <p>I've tried to correct that by encoding the filename in the POST operation and the file upload succeeds but JIRA displays the ASCII version of the encoded filename, rather than decoding the filename into the original UTF-8.</p>
  
  <p>Here is a snippet of the Python code:</p>
  
  <pre><code>files = {'file': (urllib2.quote(zd_attachment['file_name'].encode('utf8')), open('/tmp/%s' % zd_attachment['file_name'], 'rb'), zd_attachment['content_type'])}
  mp_header = {'X-Atlassian-Token': 'nocheck'}
  r = requests.post("%s/rest/api/2/issue/%s/attachments" % (jira_url, issue_id), headers=mp_header, files=files, auth=jira_auth)
  </code></pre>
  
  <p>Am I using the wrong method to encode the filename? Have I missed something else out in order to correctly handle the Unicode filename?</p>