From: Zac Medico Date: Thu, 2 Aug 2012 19:55:09 +0000 (-0700) Subject: parse_desktop_entry: fix python3 bug #429544 X-Git-Tag: v2.2.0_alpha121~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=69a95739d34b9112a60774ede71eea1661b78f2d;p=portage.git parse_desktop_entry: fix python3 bug #429544 --- diff --git a/pym/portage/util/_desktop_entry.py b/pym/portage/util/_desktop_entry.py index 790178013..8c760c043 100644 --- a/pym/portage/util/_desktop_entry.py +++ b/pym/portage/util/_desktop_entry.py @@ -31,7 +31,11 @@ def parse_desktop_entry(path): encoding=_encodings['fs'], errors='strict'), mode='r', encoding=_encodings['repo.content'], errors='replace') as f: - read_file(f) + content = f.read() + + # In Python 3.2, read_file does not support bytes in file names + # (see bug #429544), so use StringIO to hide the file name. + read_file(io.StringIO(content)) return parser