Skip to content

Commit cac5dda

Browse files
committed
Fixes
- Qt six import was broken - objectProcessor wasn't handling memoryview correctly
1 parent 8a3f1e5 commit cac5dda

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/bitmessageqt/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@
5656
import bitmessage_icons_rc # noqa:F401 pylint: disable=unused-import
5757
import helper_sent
5858

59-
from six.moves import iteritems, itervalues, range as xrange
60-
from six import text_type
59+
from six import iteritems, itervalues, text_type
6160

6261
try:
6362
from plugins.plugin import get_plugin, get_plugins

src/class_objectProcessor.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,19 @@ def checkackdata(data):
141141
# bypass nonce and time, retain object type/version/stream + body
142142
readPosition = 16
143143

144-
if data[readPosition:] in state.ackdataForWhichImWatching:
144+
# data may be a memoryview, which is not hashable and thus
145+
# cannot be used as a dictionary key; convert the slice to bytes.
146+
ackcheckdata = bytes(data[readPosition:])
147+
148+
if ackcheckdata in state.ackdataForWhichImWatching:
145149
logger.info('This object is an acknowledgement bound for me.')
146-
del state.ackdataForWhichImWatching[data[readPosition:]]
150+
del state.ackdataForWhichImWatching[ackcheckdata]
147151
sqlExecute(
148152
"UPDATE sent SET status='ackreceived', lastactiontime=?"
149-
" WHERE ackdata=?", int(time.time()), data[readPosition:])
153+
" WHERE ackdata=?", int(time.time()), ackcheckdata)
150154
queues.UISignalQueue.put((
151155
'updateSentItemStatusByAckdata', (
152-
data[readPosition:],
156+
ackcheckdata,
153157
_translate(
154158
"MainWindow",
155159
"Acknowledgement of the message received %1"

0 commit comments

Comments
 (0)