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 C88EB1382DE for ; Thu, 30 Jun 2016 20:45:02 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EB0B8E0B03; Thu, 30 Jun 2016 20:45:00 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9BCB0E0B03 for ; Thu, 30 Jun 2016 20:45:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 14B59340AE2 for ; Thu, 30 Jun 2016 20:44:59 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B949FB3D for ; Thu, 30 Jun 2016 20:44: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: <1467319164.b72e032ea252757c4309516c865fafaf7354036b.fuzzyray@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/equery/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/equery/uses.py X-VCS-Directories: pym/gentoolkit/equery/ X-VCS-Committer: fuzzyray X-VCS-Committer-Name: Paul Varner X-VCS-Revision: b72e032ea252757c4309516c865fafaf7354036b X-VCS-Branch: master Date: Thu, 30 Jun 2016 20:44: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: acb9222f-86f8-40e8-8542-1cdb9b8caa19 X-Archives-Hash: 8ea7df167f9ef540cfd8ed526064dfda commit: b72e032ea252757c4309516c865fafaf7354036b Author: Paul Varner gentoo org> AuthorDate: Thu Jun 30 20:39:24 2016 +0000 Commit: Paul Varner gentoo org> CommitDate: Thu Jun 30 20:39:24 2016 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=b72e032e equery: Fix UnicodeDecodeError in python2.7 This fix explicitly decodes the content of the USE description files as UTF-8. This fixes the UnicodeDecodeError in Python 2.7. Tested with a POSIX locale with Python 2.7, 3.4 and 3.5. X-Gentoo-bug: 587606 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=587606 pym/gentoolkit/equery/uses.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pym/gentoolkit/equery/uses.py b/pym/gentoolkit/equery/uses.py index 79ed00f..adf8b6c 100644 --- a/pym/gentoolkit/equery/uses.py +++ b/pym/gentoolkit/equery/uses.py @@ -138,6 +138,7 @@ def get_global_useflags(): path = os.path.join(settings["PORTDIR"], 'profiles', 'use.desc') with open(_unicode_encode(path, encoding=_encodings['fs'])) as open_file: for line in open_file: + line = _unicode_decode(line) if line.startswith('#'): continue # Ex. of fields: ['syslog', 'Enables support for syslog\n'] @@ -158,6 +159,7 @@ def get_global_useflags(): try: with open(_unicode_encode(path, encoding=_encodings['fs'])) as open_file: for line in open_file: + line = _unicode_decode(line) if line.startswith('#'): continue fields = [field.strip() for field in line.split(" - ", 1)]