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 449F4138334 for ; Mon, 20 May 2019 04:46:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 51DDDE0883; Mon, 20 May 2019 04:46:43 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 357C3E0883 for ; Mon, 20 May 2019 04:46:43 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C0C9D344B52 for ; Mon, 20 May 2019 04:46:41 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5C7F75EC for ; Mon, 20 May 2019 04:46:39 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1558327494.f69c2596ff6f483bec55c17918e4e17df6236b89.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/util/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/util/_get_vm_info.py X-VCS-Directories: lib/portage/util/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: f69c2596ff6f483bec55c17918e4e17df6236b89 X-VCS-Branch: master Date: Mon, 20 May 2019 04:46:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 07219250-6eb4-4170-9bdb-c4b688227878 X-Archives-Hash: 961efd7cc63fd375d8661f7e822dceb9 commit: f69c2596ff6f483bec55c17918e4e17df6236b89 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Mon May 13 15:15:03 2019 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon May 20 04:44:54 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f69c2596 get_vm_info: Set C locale for subprocesses. Parsing of localized output of subprocesses would fail, making `emerge --info` not display information about memory and swap. Bug: https://bugs.gentoo.org/685854 Signed-off-by: Arfrever Frehtes Taifersar Arahesis Apache.Org> Signed-off-by: Zac Medico gentoo.org> lib/portage/util/_get_vm_info.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/portage/util/_get_vm_info.py b/lib/portage/util/_get_vm_info.py index e8ad93805..802365dd7 100644 --- a/lib/portage/util/_get_vm_info.py +++ b/lib/portage/util/_get_vm_info.py @@ -1,4 +1,4 @@ -# Copyright 2013 Gentoo Foundation +# Copyright 2013-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 import os @@ -11,10 +11,13 @@ def get_vm_info(): vm_info = {} + env = os.environ.copy() + env["LC_ALL"] = "C" + if platform.system() == 'Linux': try: proc = subprocess.Popen(["free"], - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env) except OSError: pass else: @@ -49,7 +52,7 @@ def get_vm_info(): try: proc = subprocess.Popen(["sysctl", "-a"], - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env) except OSError: pass else: