From 31b4d0cb3a183e29fe0d745187470ded37ffd433 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 11 Jan 2012 17:34:49 -0800 Subject: [PATCH] read_corresponding_eapi_file: unicode, bug 398587 --- pym/portage/util/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index 58501dca6..13aa721ac 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -388,7 +388,9 @@ def read_corresponding_eapi_file(filename): default = "0" eapi_file = os.path.join(os.path.dirname(filename), "eapi") try: - f = open(eapi_file, "r") + f = io.open(_unicode_encode(eapi_file, + encoding=_encodings['fs'], errors='strict'), + mode='r', encoding=_encodings['repo.content'], errors='replace') lines = f.readlines() if len(lines) == 1: eapi = lines[0].rstrip("\n") -- 2.26.2