Message284818
I can confirm that this patch solves the issues I've had where I can submit multipart forms provided I have a string URL, but not if it's unicode.
I'm using Python 2.7.12. Applying the patch fixes the issue.
Code which breaks, assuming the file contains binary data:
# -*- encoding: utf-8 -*-
import urllib3
pool_manager = urllib3.PoolManager(num_pools=2)
url = u'http://example.org/form' # removing the 'u' fixes it
content = open('/some/binary/file').read()
fields = [
('foo', 'something'),
('bar', ('/some/binary/file', content, 'application/octet-stream'))
]
pool_manager.request("POST", url, fields=fields, encode_multipart=True, headers={}) |
|
Date |
User |
Action |
Args |
2017-01-06 13:28:39 | Herman Schistad | set | recipients:
+ Herman Schistad, orsenthil, vstinner, demian.brecht, Bob.Chen |
2017-01-06 13:28:39 | Herman Schistad | set | messageid: <1483709319.53.0.0850201266256.issue22231@psf.upfronthosting.co.za> |
2017-01-06 13:28:39 | Herman Schistad | link | issue22231 messages |
2017-01-06 13:28:39 | Herman Schistad | create | |
|