From 0600116354870de267eb0d48ecd01f12b9d58659 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 21 Sep 2009 22:02:09 +0000 Subject: [PATCH] Encode/decode names from the xpak index where appropriate. svn path=/main/trunk/; revision=14367 --- pym/portage/xpak.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pym/portage/xpak.py b/pym/portage/xpak.py index 8838891ca..b753f2490 100644 --- a/pym/portage/xpak.py +++ b/pym/portage/xpak.py @@ -209,6 +209,8 @@ def getindex_mem(myindex): def searchindex(myindex,myitem): """(index,item) -- Finds the offset and length of the file 'item' in the datasegment via the index 'index' provided.""" + myitem = _unicode_encode(myitem, + encoding=_encodings['repo.content'], errors='backslashreplace') mylen=len(myitem) myindexlen=len(myindex) startpos=0 @@ -416,6 +418,8 @@ class tbz2(object): datapos=decodeint(self.index[startpos+4+namelen:startpos+8+namelen]); datalen=decodeint(self.index[startpos+8+namelen:startpos+12+namelen]); myname=self.index[startpos+4:startpos+4+namelen] + myname = _unicode_decode(myname, + encoding=_encodings['repo.content'], errors='replace') dirname=os.path.dirname(myname) if dirname: if not os.path.exists(dirname): -- 2.26.2