read_corresponding_eapi_file: unicode, bug 398587
authorZac Medico <zmedico@gentoo.org>
Thu, 12 Jan 2012 01:34:49 +0000 (17:34 -0800)
committerZac Medico <zmedico@gentoo.org>
Thu, 12 Jan 2012 01:34:49 +0000 (17:34 -0800)
pym/portage/util/__init__.py

index 58501dca6c2e3bb09c70ba8aacc7532190ed91b2..13aa721aca88d50311800d4d899af17086be86fa 100644 (file)
@@ -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")