Skip to content

Commit

Permalink
widgets: Fix faulty save_state() under Python 3
Browse files Browse the repository at this point in the history
The result of `toBase64().data()`, bytes data, was wrapped into a string
using `ustr()` causing the resulting trying to be a *representation* of
the bytes (wrapped into `b''`), thus being buggy data.

I've replaced this with a proper ".decode()" call.

I've tried keeping it as bytes, but that didn't go through
serialization.

Fixes #236

Signed-off-by: Virgil Dupras <hsoft@hardcoded.net>
  • Loading branch information
Virgil Dupras committed Mar 8, 2014
1 parent f7e7911 commit 50ef17c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cola/widgets/standard.py
Expand Up @@ -10,7 +10,6 @@
from cola import gitcfg
from cola import qtcompat
from cola import settings
from cola.compat import ustr


class WidgetMixin(object):
Expand Down Expand Up @@ -101,7 +100,7 @@ def export_state(self):
state = WidgetMixin.export_state(self)
windowstate = self.saveState(self.widget_version)
state['lock_layout'] = self.lock_layout
state['windowstate'] = ustr(windowstate.toBase64().data())
state['windowstate'] = windowstate.toBase64().data().decode('ascii')
return state

def apply_state(self, state):
Expand Down

0 comments on commit 50ef17c

Please sign in to comment.