[gnome-continuous-yocto/gnomeostree-3.28-rocko: 639/8267] bitbake: toaster: read timezone files in binary mode
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 639/8267] bitbake: toaster: read timezone files in binary mode
- Date: Sat, 16 Dec 2017 20:42:31 +0000 (UTC)
commit 5074c600f3133cf1f89b4cc0e3b61a6d8fd2236e
Author: Ed Bartosh <ed bartosh linux intel com>
Date: Tue May 10 17:18:22 2016 +0300
bitbake: toaster: read timezone files in binary mode
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]
(Bitbake rev: 1414866b84fe1fd674ea79500cd62eda3aa30b33)
Signed-off-by: Ed Bartosh <ed bartosh linux intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
bitbake/lib/toaster/toastermain/settings.py | 7 +++----
1 files 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]