From 69a95739d34b9112a60774ede71eea1661b78f2d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 2 Aug 2012 12:55:09 -0700 Subject: [PATCH] parse_desktop_entry: fix python3 bug #429544 --- pym/portage/util/_desktop_entry.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.26.2