summaryrefslogtreecommitdiffstats
path: root/Lib/dumbdbm.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-28 00:09:54 (GMT)
committerGuido van Rossum <guido@python.org>2007-08-28 00:09:54 (GMT)
commit7b4beea02e6bf1db96c95781e3bb7e5233afc917 (patch)
tree42a4db441fb26f5f4c2306a532ee180bb1079ef4 /Lib/dumbdbm.py
parentbb839ef8ac446b0cb80ab4b818b111068af6a65c (diff)
downloadcpython-7b4beea02e6bf1db96c95781e3bb7e5233afc917.zip
cpython-7b4beea02e6bf1db96c95781e3bb7e5233afc917.tar.gz
cpython-7b4beea02e6bf1db96c95781e3bb7e5233afc917.tar.bz2
Make dumbdbm use bytes for keys consistently.
Diffstat (limited to 'Lib/dumbdbm.py')
-rw-r--r--Lib/dumbdbm.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/dumbdbm.py b/Lib/dumbdbm.py
index ad3ebcb..b47b7bd 100644
--- a/Lib/dumbdbm.py
+++ b/Lib/dumbdbm.py
@@ -200,7 +200,11 @@ class _Database(UserDict.DictMixin):
self._commit()
def keys(self):
- return self._index.keys()
+ return [key.encode("latin-1") for key in self._index.keys()]
+
+ def items(self):
+ return [(key.encode("latin-1"), self[key.encode("latin-1")])
+ for key in self._index.keys()]
def __contains__(self, key):
key = key.decode("latin-1")