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 BA4DB1396D0 for ; Wed, 6 Sep 2017 18:33:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E26F8E0D39; Wed, 6 Sep 2017 18:33:57 +0000 (UTC) Received: from smtp.gentoo.org (mail.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 BF9AFE0D39 for ; Wed, 6 Sep 2017 18:33:57 +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 550E133E4AD for ; Wed, 6 Sep 2017 18:33:56 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DCBC98B8C for ; Wed, 6 Sep 2017 18:33:54 +0000 (UTC) From: "Paul Varner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Paul Varner" Message-ID: <1504722339.308e33dc9e0cba958a583d86799dcb660ba39cb1.fuzzyray@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/package.py X-VCS-Directories: pym/gentoolkit/ X-VCS-Committer: fuzzyray X-VCS-Committer-Name: Paul Varner X-VCS-Revision: 308e33dc9e0cba958a583d86799dcb660ba39cb1 X-VCS-Branch: master Date: Wed, 6 Sep 2017 18:33:54 +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-Archives-Salt: cccd3f8b-b9b7-4ff9-9d4a-3c0872712b2e X-Archives-Hash: bea7d0bfdc85219e15740f48ecac3731 commit: 308e33dc9e0cba958a583d86799dcb660ba39cb1 Author: Paul Varner gentoo org> AuthorDate: Wed Sep 6 18:25:39 2017 +0000 Commit: Paul Varner gentoo org> CommitDate: Wed Sep 6 18:25:39 2017 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=308e33dc equery: size: Fix UnicodeDecodeError Encode the filename before calling os.lstat X-Gentoo-Bug: 531636 X-Gentoo-Bug-URL: https://bugs.gentoo.org/531636 pym/gentoolkit/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pym/gentoolkit/package.py b/pym/gentoolkit/package.py index 42b632b..149ca74 100644 --- a/pym/gentoolkit/package.py +++ b/pym/gentoolkit/package.py @@ -46,6 +46,7 @@ from string import Template import portage from portage.util import LazyItemsDict +from portage import _encodings, _unicode_decode, _unicode_encode import gentoolkit.pprinter as pp from gentoolkit import errors @@ -380,7 +381,7 @@ class Package(CPV): size = n_files = n_uncounted = 0 for path in self.parsed_contents(prefix_root=True): try: - st = os.lstat(path) + st = os.lstat(_unicode_encode(path, encoding=_encodings['fs'])) except OSError: continue