import portage
from portage import os
from portage import _encodings
+from portage import _unicode_decode
from portage import _unicode_encode
+from _emerge.Package import _all_metadata_keys
import sys
import socket
myid,myglob = data
mydict = {}
- for x in portage.xpak.getindex_mem(myid):
- mydict[x] = portage.xpak.getitem(data,x)
+ for k_bytes in portage.xpak.getindex_mem(myid):
+ k = _unicode_decode(k_bytes,
+ encoding=_encodings['repo.content'], errors='replace')
+ if k not in _all_metadata_keys and \
+ k != "CATEGORY":
+ continue
+ v = _unicode_decode(portage.xpak.getitem(data, k_bytes),
+ encoding=_encodings['repo.content'], errors='replace')
+ mydict[k] = v
return mydict
if page:
parser = ParseLinks()
- parser.feed(page)
+ parser.feed(_unicode_decode(page))
del page
listing = parser.get_anchors()
else: