This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Herman Schistad
Recipients Bob.Chen, Herman Schistad, demian.brecht, orsenthil, vstinner
Date 2017-01-06.13:28:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1483709319.53.0.0850201266256.issue22231@psf.upfronthosting.co.za>
In-reply-to
Content
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={})
History
Date User Action Args
2017-01-06 13:28:39Herman Schistadsetrecipients: + Herman Schistad, orsenthil, vstinner, demian.brecht, Bob.Chen
2017-01-06 13:28:39Herman Schistadsetmessageid: <1483709319.53.0.0850201266256.issue22231@psf.upfronthosting.co.za>
2017-01-06 13:28:39Herman Schistadlinkissue22231 messages
2017-01-06 13:28:39Herman Schistadcreate