commit: 308e33dc9e0cba958a583d86799dcb660ba39cb1 Author: Paul Varner <fuzzyray <AT> gentoo <DOT> org> AuthorDate: Wed Sep 6 18:25:39 2017 +0000 Commit: Paul Varner <fuzzyray <AT> gentoo <DOT> 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