From: Zac Medico Date: Mon, 21 Sep 2009 22:02:09 +0000 (-0000) Subject: Encode/decode names from the xpak index where appropriate. X-Git-Tag: v2.2_rc42~57 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0600116354870de267eb0d48ecd01f12b9d58659;p=portage.git Encode/decode names from the xpak index where appropriate. svn path=/main/trunk/; revision=14367 --- 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):