diff options
author | Walter Dörwald <walter@livinglogic.de> | 2005-03-31 13:57:38 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2005-03-31 13:57:38 (GMT) |
commit | a6e8a4ad12d030de1664f1b1df27e0496dd488e9 (patch) | |
tree | 26adad39afbf24cb60cd5b220372d1a2d4c9b376 /Lib/distutils | |
parent | b330adf9ebff10b55a3a5d1bedc2ccf5bee72b74 (diff) | |
download | cpython-a6e8a4ad12d030de1664f1b1df27e0496dd488e9.zip cpython-a6e8a4ad12d030de1664f1b1df27e0496dd488e9.tar.gz cpython-a6e8a4ad12d030de1664f1b1df27e0496dd488e9.tar.bz2 |
Since PyPI only accepts UTF-8 encoded data now, make sure that the data is
properly encoded and include the encoding in the Content-Type header.
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/command/register.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/distutils/command/register.py b/Lib/distutils/command/register.py index 6e9a8d4..dec9aa2 100644 --- a/Lib/distutils/command/register.py +++ b/Lib/distutils/command/register.py @@ -254,7 +254,7 @@ Your selection [default 1]: ''', if type(value) != type([]): value = [value] for value in value: - value = str(value) + value = unicode(value).encode("utf-8") body.write(sep_boundary) body.write('\nContent-Disposition: form-data; name="%s"'%key) body.write("\n\n") @@ -267,7 +267,7 @@ Your selection [default 1]: ''', # build the Request headers = { - 'Content-type': 'multipart/form-data; boundary=%s'%boundary, + 'Content-type': 'multipart/form-data; boundary=%s; charset=utf-8'%boundary, 'Content-length': str(len(body)) } req = urllib2.Request(self.repository, body, headers) |