From 3df9061abdeba371dabcab9754be90866ff1d0ad Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 24 Sep 2009 22:15:48 +0000 Subject: Fix regression in _getitem() from r14398, since myf.read().split("\n") yields an empty string at the end which is causes _parse_data() to catch a ValueError and raise CacheCorruption. svn path=/main/trunk/; revision=14416 --- pym/portage/cache/flat_hash.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pym') diff --git a/pym/portage/cache/flat_hash.py b/pym/portage/cache/flat_hash.py index 983055a4b..49d7ce6a0 100644 --- a/pym/portage/cache/flat_hash.py +++ b/pym/portage/cache/flat_hash.py @@ -41,7 +41,10 @@ class database(fs_template.FsBased): mode='r', encoding=_encodings['repo.content'], errors='replace') try: - d = self._parse_data(myf.read().split("\n"), cpv) + lines = myf.read().split("\n") + if not lines[-1]: + lines.pop() + d = self._parse_data(lines, cpv) if '_mtime_' not in d: # Backward compatibility with old cache # that uses mtime mangling. -- cgit v1.2.3-1-g7c22