aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>2010-12-06 13:50:52 +0100
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>2010-12-06 13:50:52 +0100
commitecaa391a9a3bcfa338b9f29d9da6ec6bea4ed5d8 (patch)
tree8f3cce7a3f409b901cbc779cbb393e0a35585466 /pym/portage/dbapi/bintree.py
parentinject binpkg after fetch for pkg_pretend (diff)
downloadportage-ecaa391a9a3bcfa338b9f29d9da6ec6bea4ed5d8.tar.gz
portage-ecaa391a9a3bcfa338b9f29d9da6ec6bea4ed5d8.tar.bz2
portage-ecaa391a9a3bcfa338b9f29d9da6ec6bea4ed5d8.zip
Use bytes literals.
Diffstat (limited to 'pym/portage/dbapi/bintree.py')
-rw-r--r--pym/portage/dbapi/bintree.py22
1 files changed, 6 insertions, 16 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index a4ec224e3..d1c1e2a4b 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -333,12 +333,10 @@ class binarytree(object):
mydata = mytbz2.get_data()
updated_items = update_dbentries([mylist], mydata)
mydata.update(updated_items)
- mydata[_unicode_encode('PF',
- encoding=_encodings['repo.content'])] = \
+ mydata[b'PF'] = \
_unicode_encode(mynewpkg + "\n",
encoding=_encodings['repo.content'])
- mydata[_unicode_encode('CATEGORY',
- encoding=_encodings['repo.content'])] = \
+ mydata[b'CATEGORY'] = \
_unicode_encode(mynewcat + "\n",
encoding=_encodings['repo.content'])
if mynewpkg != myoldpkg:
@@ -439,9 +437,7 @@ class binarytree(object):
if st is not None:
# For invalid packages, other_cat could be None.
- other_cat = portage.xpak.tbz2(dest_path).getfile(
- _unicode_encode("CATEGORY",
- encoding=_encodings['repo.content']))
+ other_cat = portage.xpak.tbz2(dest_path).getfile(b"CATEGORY")
if other_cat:
other_cat = _unicode_decode(other_cat,
encoding=_encodings['repo.content'], errors='replace')
@@ -621,17 +617,11 @@ class binarytree(object):
self.invalids.append(myfile[:-5])
continue
metadata_bytes = portage.xpak.tbz2(full_path).get_data()
- mycat = _unicode_decode(metadata_bytes.get(
- _unicode_encode("CATEGORY",
- encoding=_encodings['repo.content']), ""),
+ mycat = _unicode_decode(metadata_bytes.get(b"CATEGORY", ""),
encoding=_encodings['repo.content'], errors='replace')
- mypf = _unicode_decode(metadata_bytes.get(
- _unicode_encode("PF",
- encoding=_encodings['repo.content']), ""),
+ mypf = _unicode_decode(metadata_bytes.get(b"PF", ""),
encoding=_encodings['repo.content'], errors='replace')
- slot = _unicode_decode(metadata_bytes.get(
- _unicode_encode("SLOT",
- encoding=_encodings['repo.content']), ""),
+ slot = _unicode_decode(metadata_bytes.get(b"SLOT", ""),
encoding=_encodings['repo.content'], errors='replace')
mypkg = myfile[:-5]
if not mycat or not mypf or not slot: