diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2013-12-22 18:14:56 +0100 |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-12-22 18:14:56 +0100 |
| commit | 6f6cd52ff5909a2b176e2b2d054bc14a46482175 (patch) | |
| tree | 4d06e3b4e37bf6f0efcb0ffdc5d85389b120e837 /config.py | |
| parent | 91bb029d7e809b5561df7c3ffc1253b20e65ea88 (diff) | |
| parent | a9d129418d7569a12e225e130711524a89868eca (diff) | |
| download | python-setuptools-git-6f6cd52ff5909a2b176e2b2d054bc14a46482175.tar.gz | |
Fix TypeError on "setup.py upload --show-response".
Diffstat (limited to 'config.py')
| -rw-r--r-- | config.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -3,6 +3,7 @@ Provides the PyPIRCCommand class, the base class for the command classes that uses .pypirc in the distutils.command package. """ +import cgi import os from configparser import ConfigParser @@ -110,6 +111,12 @@ class PyPIRCCommand(Command): return {} + def _read_pypi_response(self, response): + """Read and decode a PyPI HTTP response.""" + content_type = response.getheader('content-type', 'text/plain') + encoding = cgi.parse_header(content_type)[1].get('charset', 'ascii') + return response.read().decode(encoding) + def initialize_options(self): """Initialize options.""" self.repository = None |
