From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6CDE4138334 for ; Wed, 23 Oct 2019 10:10:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6D9BDE09F7; Wed, 23 Oct 2019 10:10:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2A49AE09A4 for ; Wed, 23 Oct 2019 10:10:36 +0000 (UTC) Received: from localhost.localdomain (c134-66.icpnet.pl [85.221.134.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id DDD3734C245; Wed, 23 Oct 2019 10:10:34 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: python@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH] python-utils-r1.eclass: Fix python_optimize to take all of sys.path Date: Wed, 23 Oct 2019 12:10:09 +0200 Message-Id: <20191023101009.156716-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.23.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: dec891a4-5425-4298-bb29-c7db5d3927cf X-Archives-Hash: ee807061256ca341422e884171fd0a90 Make sure to append NUL to every path in sys.path, rather than using it as a separator between output entries. This fixes a bug when the last path entry was silently discarded, and the function stopped working with PyPy as a result. Signed-off-by: Michał Górny --- eclass/python-utils-r1.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index f8f51ecb694a..549dd5f2e56e 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -692,7 +692,7 @@ python_optimize() { if [[ ${f} == /* && -d ${D%/}${f} ]]; then set -- "${D%/}${f}" "${@}" fi - done < <("${PYTHON}" -c 'import sys; print("\0".join(sys.path))' || die) + done < <("${PYTHON}" -c 'import sys; print("".join(x + "\0" for x in sys.path))' || die) debug-print "${FUNCNAME}: using sys.path: ${*/%/;}" fi -- 2.23.0