[Python-modules-team] Bug#834875: regression: qsettings can no longer save binary strings

Dmitry Shachnev mitya57 at debian.org
Sat Aug 27 21:07:10 UTC 2016


Hi Salvo,

On Sat, Aug 20, 2016 at 09:18:51AM +0200, Salvo Tomaselli wrote:
> in relational, I store the session as a binary string generated with the pickle
> module and save it using QSettings.
> 
> now the functionality is broken, without changing the code in relational, so
> it is a regression in Qt or PyQt.

Now this is fixed. However storing pickled strings in QSettings usually does
not make much sense.

When a non-Qt object (such as bytes) is stored in QSettings, it gets pickled
by PyQt. So in your case there will be double pickling.

You can either store the object directly, or wrap the bytestring into a
QtCore.QByteArray (which is a native Qt object).

-- 
Dmitry Shachnev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20160828/d29f52f7/attachment.sig>


More information about the Python-modules-team mailing list