Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1234150ybi; Fri, 14 Jun 2019 10:53:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwN6JxtmF+hX9648ChF2FkMpe2ygGMvEtREkVKMKzu6GjVwGP5LxNJYKpITDW+ctsOsxGCS X-Received: by 2002:a17:90a:bb94:: with SMTP id v20mr12571951pjr.88.1560534792639; Fri, 14 Jun 2019 10:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560534792; cv=none; d=google.com; s=arc-20160816; b=b0R7ouUwMjHqcgpSunyn/PVUmqvCm0RBycZ7xzfk7z/UvsWNzBFqpR4cWJk1AITcqW iiznK+vwYdPDIqHl5GHZV2XqtmSEL1IIkBogd1dG+XugLN9IIYRQ5oAuzrEugY2GV2Dh 9ZvdIecrIGdAA5SvWMRqmKmw4BwJZr4m30lLDczQnITmd8NS0QPVHAqi/kEZq6Q1LfSG xZlg6yUwoW7B4RAPYwi4bIpCB6BuIS/EU5YjXlLglE9Dubt+NH3Lhxrwzx1Gyme1J8U6 1i/cVZBTrQ9AeTJy9kLvWs/e0nYyPcX/FDguzZbiGQpRDDJ/Lc4wLwkXzgxZLnaJ51h6 9EVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WNiRsq7voQTs7B1oPyVixDdCGhlnrWKg3Vv2Nss1FD8=; b=Pzgg6ViGd0x+DjqRIi8/d+1AUgQjyhpG8VNkZ0eInJ/v18PMiSKghZIfe7nRJovHtA Kek0+HFW4hpfhMakAUGpy69sfQBuQqPRPhBZzpMZ2neIOfE2C0n+8oAJkeQdWkH47cup FsDl/mp+FhU1oUQ30akFl267/UWiuIimYuWYPB8r/Wep7RVYbIVl8146mK3lUSqxw/sr X1Ru+bgYiUKpsm0RY+c61bYHv0Jl6+1q6IvmGBrwfyAd+E7862FI0vIFrAaW0g0uBOnE B1fnXrGoksgW6tvsFS5Ylqd9v1bZq8lw2cf+O77+ZOUann5xvAV97+eY5K6sv8hru2x4 7sqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kkWV5+Dy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5si2712017pjp.77.2019.06.14.10.52.57; Fri, 14 Jun 2019 10:53:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kkWV5+Dy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727021AbfFNRwl (ORCPT + 99 others); Fri, 14 Jun 2019 13:52:41 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:38618 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726596AbfFNRwe (ORCPT ); Fri, 14 Jun 2019 13:52:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WNiRsq7voQTs7B1oPyVixDdCGhlnrWKg3Vv2Nss1FD8=; b=kkWV5+DyTvzf1HePB9t3K7/LFg WuHQyJZM42+cYmkMZmFIQFEclXJ6fEnb5Xjrk9mZWDRtUxv9RZpYxDzODJLYWc4BlU3PkwBn2ki3J tBh/Zmiiu7Y45YewFCjTUjFon2xrhFqTKwVcuUoj5ZzyKL8NSoQt9MeX+zIKKXed7DBd/45FP8RXo lHVHEVkQGpwVoJ+zSS5Yi/8uZTgsNNTGmwE0BkzlRqDyfzT+Qfs3c8OmIlvMFoUFFt0aoSQ9vzqYi mmS9Tr70xL0DqKYPvW8Umb7MpOqtx6tjFSsvmGBtNTAO9R4bB2SHfJm5vNMy/E/NXuNooOgE74QVM 5xD6eoIQ==; Received: from 177.133.85.52.dynamic.adsl.gvt.net.br ([177.133.85.52] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hbqNO-0000Pa-KU; Fri, 14 Jun 2019 17:52:34 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.92) (envelope-from ) id 1hbqNM-0002PJ-23; Fri, 14 Jun 2019 14:52:32 -0300 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Greg Kroah-Hartman Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet Subject: [PATCH v2 14/16] docs: sphinx/kernel_abi.py: fix UTF-8 support Date: Fri, 14 Jun 2019 14:52:28 -0300 Message-Id: <8797b79370b399ffa6c614be966a7b80289153be.1560534648.git.mchehab+samsung@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <3b8d7c64f887ddea01df3c4eeabc745c8ec45406.1560534648.git.mchehab+samsung@kernel.org> References: <3b8d7c64f887ddea01df3c4eeabc745c8ec45406.1560534648.git.mchehab+samsung@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The parser breaks with UTF-8 characters with Sphinx 1.4. Signed-off-by: Mauro Carvalho Chehab --- Documentation/sphinx/kernel_abi.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/Documentation/sphinx/kernel_abi.py b/Documentation/sphinx/kernel_abi.py index 32ce90775d96..0f3e51e67e8d 100644 --- a/Documentation/sphinx/kernel_abi.py +++ b/Documentation/sphinx/kernel_abi.py @@ -1,4 +1,5 @@ -# -*- coding: utf-8; mode: python -*- +# coding=utf-8 +# u""" kernel-abi ~~~~~~~~~~ @@ -28,6 +29,7 @@ u""" """ +import codecs import sys import os from os import path @@ -43,14 +45,6 @@ from docutils.utils.error_reporting import ErrorString __version__ = '1.0' -# We can't assume that six is installed -PY3 = sys.version_info[0] == 3 -PY2 = sys.version_info[0] == 2 -if PY3: - # pylint: disable=C0103, W0622 - unicode = str - basestring = str - def setup(app): app.add_directive("kernel-abi", KernelCmd) @@ -115,12 +109,12 @@ class KernelCmd(Directive): cmd , stdout = subprocess.PIPE , stderr = subprocess.PIPE - , universal_newlines = True , **kwargs ) out, err = proc.communicate() - if err: - self.warn(err) + + out, err = codecs.decode(out, 'utf-8'), codecs.decode(err, 'utf-8') + if proc.returncode != 0: raise self.severe( u"command '%s' failed with return code %d" @@ -129,7 +123,7 @@ class KernelCmd(Directive): except OSError as exc: raise self.severe(u"problems with '%s' directive: %s." % (self.name, ErrorString(exc))) - return unicode(out) + return out def nestedParse(self, lines, fname): content = ViewList() -- 2.21.0