* [gentoo-commits] portage r14416 - main/trunk/pym/portage/cache
@ 2009-09-24 22:15 Zac Medico (zmedico)
0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2009-09-24 22:15 UTC (permalink / raw
To: gentoo-commits
Author: zmedico
Date: 2009-09-24 22:15:48 +0000 (Thu, 24 Sep 2009)
New Revision: 14416
Modified:
main/trunk/pym/portage/cache/flat_hash.py
Log:
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.
Modified: main/trunk/pym/portage/cache/flat_hash.py
===================================================================
--- main/trunk/pym/portage/cache/flat_hash.py 2009-09-24 21:50:10 UTC (rev 14415)
+++ main/trunk/pym/portage/cache/flat_hash.py 2009-09-24 22:15:48 UTC (rev 14416)
@@ -41,7 +41,10 @@
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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-09-24 22:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-24 22:15 [gentoo-commits] portage r14416 - main/trunk/pym/portage/cache Zac Medico (zmedico)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox