diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2020-02-11 22:15:31 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-02-11 22:15:31 -0500 |
commit | ce8e3ee174ed9dee84aa08a461fb174ac1e53535 (patch) | |
tree | da78c024b4491210e61b73e9e2f755d46c8bc1ff /setuptools/command/upload_docs.py | |
parent | 53b8523fdfa19173d2e6b11d6b4d175f54b9dfea (diff) | |
parent | a5dec2f14e3414e4ee5dd146bff9c289d573de9a (diff) | |
download | external_python_setuptools-ce8e3ee174ed9dee84aa08a461fb174ac1e53535.tar.gz external_python_setuptools-ce8e3ee174ed9dee84aa08a461fb174ac1e53535.tar.bz2 external_python_setuptools-ce8e3ee174ed9dee84aa08a461fb174ac1e53535.zip |
Merge branch 'master' into fix/1557
Diffstat (limited to 'setuptools/command/upload_docs.py')
-rw-r--r-- | setuptools/command/upload_docs.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/setuptools/command/upload_docs.py b/setuptools/command/upload_docs.py index 07aa564a..0351da77 100644 --- a/setuptools/command/upload_docs.py +++ b/setuptools/command/upload_docs.py @@ -24,7 +24,7 @@ from .upload import upload def _encode(s): - errors = 'surrogateescape' if six.PY3 else 'strict' + errors = 'strict' if six.PY2 else 'surrogateescape' return s.encode('utf-8', errors) @@ -127,8 +127,8 @@ class upload_docs(upload): """ Build up the MIME payload for the POST data """ - boundary = b'--------------GHSKFJDLGDS7543FJKLFHRE75642756743254' - sep_boundary = b'\n--' + boundary + boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254' + sep_boundary = b'\n--' + boundary.encode('ascii') end_boundary = sep_boundary + b'--' end_items = end_boundary, b"\n", builder = functools.partial( @@ -138,7 +138,7 @@ class upload_docs(upload): part_groups = map(builder, data.items()) parts = itertools.chain.from_iterable(part_groups) body_items = itertools.chain(parts, end_items) - content_type = 'multipart/form-data; boundary=%s' % boundary.decode('ascii') + content_type = 'multipart/form-data; boundary=%s' % boundary return b''.join(body_items), content_type def upload_file(self, filename): @@ -153,7 +153,7 @@ class upload_docs(upload): # set up the authentication credentials = _encode(self.username + ':' + self.password) credentials = standard_b64encode(credentials) - if six.PY3: + if not six.PY2: credentials = credentials.decode('ascii') auth = "Basic " + credentials |