We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A Boolean value is retrieved as unicode from QSettings' storage. The line https://github.com/mfitzp/pyqtconfig/blob/master/pyqtconfig/config.py#L983 compares the type to basestring, which then returns False so the type is not munged, which causes https://github.com/mfitzp/pyqtconfig/blob/master/pyqtconfig/config.py#L994 to become bool(u'value') and always return True. Changing the comparison to issubclass(vt, basestring) worked in my case.
unicode
basestring
False
bool(u'value')
True
issubclass(vt, basestring)
$ python Python 2.7.12 (default, Jul 1 2016, 15:12:24) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from PyQt5.QtCore import QT_VERSION_STR >>> print QT_VERSION_STR 5.5.1 >>> from PyQt5.Qt import PYQT_VERSION_STR >>> print PYQT_VERSION_STR 5.5.1 >>> from sip import SIP_VERSION_STR >>> print SIP_VERSION_STR 4.17 $ lsb_release -a LSB Version: core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:printing-9.20160110ubuntu0.2-amd64:printing-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS Release: 16.04 Codename: xenial
The text was updated successfully, but these errors were encountered:
mfitzp
No branches or pull requests
A Boolean value is retrieved as
unicode
from QSettings' storage. The line https://github.com/mfitzp/pyqtconfig/blob/master/pyqtconfig/config.py#L983 compares the type tobasestring
, which then returnsFalse
so the type is not munged, which causes https://github.com/mfitzp/pyqtconfig/blob/master/pyqtconfig/config.py#L994 to becomebool(u'value')
and always returnTrue
. Changing the comparison toissubclass(vt, basestring)
worked in my case.The text was updated successfully, but these errors were encountered: