Commit 89e72217 authored by Stefan H. Holek's avatar Stefan H. Holek

Can't use 'surrogateescape' in upload_docs either.

--HG--
branch : distribute
extra : rebase_source : 6e262cc5a15434bda3543868b29ea9d69c51e238
parent be8173d7
......@@ -18,6 +18,7 @@ from base64 import standard_b64encode
from pkg_resources import iter_entry_points
from distutils import log
from distutils.errors import DistutilsError
from distutils.errors import DistutilsOptionError
try:
......@@ -25,17 +26,12 @@ try:
except ImportError:
from setuptools.command.upload import upload
if sys.version_info >= (3, 1):
errors = 'surrogateescape'
else:
errors = 'strict'
# This is not just a replacement for byte literals
# but works as a general purpose encoder
def b(s, encoding='utf-8'):
if isinstance(s, unicode):
return s.encode(encoding, errors)
return s.encode(encoding)
return s
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment