summaryrefslogtreecommitdiff
path: root/Lib/distutils/command
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-12-21 22:59:06 +0100
committerAntoine Pitrou <solipsis@pitrou.net>2013-12-21 22:59:06 +0100
commit29fd05f900d3bb2f856269cb667ed424570533c6 (patch)
treec450f32c8e82d19f675fd93fb08ca60f74a3f500 /Lib/distutils/command
parent3b716fabd66042b301c4b330165cf058f03a15e4 (diff)
parent716b7222e9aca9d9f934dc68a9a828942b55d3b4 (diff)
downloadcpython-git-29fd05f900d3bb2f856269cb667ed424570533c6.tar.gz
Issue #20045: Fix "setup.py register --list-classifiers".
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r--Lib/distutils/command/register.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/distutils/command/register.py b/Lib/distutils/command/register.py
index 99545affa4..9b39ed36aa 100644
--- a/Lib/distutils/command/register.py
+++ b/Lib/distutils/command/register.py
@@ -5,6 +5,7 @@ Implements the Distutils 'register' command (register with the repository).
# created 2002/10/21, Richard Jones
+import cgi
import os, string, getpass
import io
import urllib.parse, urllib.request
@@ -87,7 +88,9 @@ class register(PyPIRCCommand):
'''
url = self.repository+'?:action=list_classifiers'
response = urllib.request.urlopen(url)
- log.info(response.read())
+ content_type = response.getheader('content-type', 'text/plain')
+ encoding = cgi.parse_header(content_type)[1].get('charset', 'ascii')
+ log.info(response.read().decode(encoding))
def verify_metadata(self):
''' Send the metadata to the package index server to be checked.