summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/check.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-10-09 05:11:19 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-10-09 05:11:19 (GMT)
commit017e535bde6e869928e4fbb0249b12721340a46e (patch)
treedcca8b93ee9c3b8ca41563cf624050b0bed9edbf /Lib/distutils/command/check.py
parentece7079b54d9a6700558210339df02e4586f698c (diff)
downloadcpython-017e535bde6e869928e4fbb0249b12721340a46e.zip
cpython-017e535bde6e869928e4fbb0249b12721340a46e.tar.gz
cpython-017e535bde6e869928e4fbb0249b12721340a46e.tar.bz2
Fix distutils’ check and register Unicode handling (#13114).
The check command was fixed by Kirill Kuzminykh. The register command was using StringIO.getvalue, which uses “''.join” and thus coerces to str using the default encoding (ASCII), so I changed the code to use one extra intermediary list and correctly encode to UTF-8.
Diffstat (limited to 'Lib/distutils/command/check.py')
-rw-r--r--Lib/distutils/command/check.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/distutils/command/check.py b/Lib/distutils/command/check.py
index bc29baa..4b64e45 100644
--- a/Lib/distutils/command/check.py
+++ b/Lib/distutils/command/check.py
@@ -5,6 +5,7 @@ Implements the Distutils 'check' command.
__revision__ = "$Id$"
from distutils.core import Command
+from distutils.dist import PKG_INFO_ENCODING
from distutils.errors import DistutilsSetupError
try:
@@ -108,6 +109,8 @@ class check(Command):
def check_restructuredtext(self):
"""Checks if the long string fields are reST-compliant."""
data = self.distribution.get_long_description()
+ if not isinstance(data, unicode):
+ data = data.decode(PKG_INFO_ENCODING)
for warning in self._check_rst_data(data):
line = warning[-1].get('line')
if line is None: