]> git.baikalelectronics.ru Git - kernel.git/commit
Documentation/sphinx: fix kernel-doc decode for non-utf-8 locale
authorJani Nikula <jani.nikula@intel.com>
Thu, 31 Aug 2017 19:21:29 +0000 (22:21 +0300)
committerJonathan Corbet <corbet@lwn.net>
Thu, 31 Aug 2017 19:36:28 +0000 (13:36 -0600)
commit0e057e7f2cab342ec712ef02496bc4eba1fa33cd
treec855556f07686d52f232f89a778d7f41f0150103
parent232007ce3cd9dabac3e4a1322f3e7072f4f55aa4
Documentation/sphinx: fix kernel-doc decode for non-utf-8 locale

On python3, Popen() universal_newlines=True converts the subprocess
stdout to unicode text using a codec based on user preferences. Given
LANG indicating ascii and utf-8 stdout from the subprocess, you'd get:

WARNING: kernel-doc '../scripts/kernel-doc -rst -enable-lineno
../drivers/media/dvb-core/demux.h' processing failed with: 'ascii' codec can't
decode byte 0xe2 in position 6368: ordinal not in range(128)

Fix this by dropping universal_newlines=True and replacing the implicit
LANG specific decode with an explicit utf-8 decode. This also gets rid
of the annoying conditional code for python 2 vs. 3.

Fixes: 3f7e4784d5df ("Documentation/sphinx: fix kernel-doc extension on python3")
Reference: http://mid.mail-archive.com/54c23e8e-89c0-5cea-0dcc-e938952c5642@infradead.org
Reported-and-tested-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/sphinx/kerneldoc.py