Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id C42E7E00F0F; Wed, 11 May 2016 02:59:36 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id A8E3DE00EF5 for ; Wed, 11 May 2016 02:59:30 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP; 11 May 2016 02:59:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,608,1455004800"; d="scan'208";a="963508768" Received: from linux.intel.com ([10.23.219.25]) by fmsmga001.fm.intel.com with ESMTP; 11 May 2016 02:59:32 -0700 Received: from vmed.fi.intel.com (vmed.fi.intel.com [10.237.72.51]) by linux.intel.com (Postfix) with ESMTP id 15C1B6A4008 for ; Wed, 11 May 2016 03:47:02 -0700 (PDT) From: Ed Bartosh To: toaster@yoctoproject.org Date: Wed, 11 May 2016 10:38:09 +0300 Message-Id: <236e8a5992df1eaaadd074237f4e2cecce159384.1462892580.git.ed.bartosh@linux.intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [PATCH 15/16] toaster: read timezone files in binary mode X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2016 09:59:36 -0000 Used 'rb' mode to open files to avoid unicode error when code runs on python 3: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 44: invalid start byte [YOCTO #9584] Signed-off-by: Ed Bartosh --- bitbake/lib/toaster/toastermain/settings.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index c7edff2..3dfa2b2 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py @@ -87,17 +87,16 @@ else: try: import pytz from pytz.exceptions import UnknownTimeZoneError - pass try: if pytz.timezone(zonename) is not None: - zonefilelist[hashlib.md5(open(filepath).read()).hexdigest()] = zonename + zonefilelist[hashlib.md5(open(filepath, 'rb').read()).hexdigest()] = zonename except UnknownTimeZoneError as ValueError: # we expect timezone failures here, just move over pass except ImportError: - zonefilelist[hashlib.md5(open(filepath).read()).hexdigest()] = zonename + zonefilelist[hashlib.md5(open(filepath, 'rb').read()).hexdigest()] = zonename - TIME_ZONE = zonefilelist[hashlib.md5(open('/etc/localtime').read()).hexdigest()] + TIME_ZONE = zonefilelist[hashlib.md5(open('/etc/localtime', 'rb').read()).hexdigest()] # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html -- 2.1.4