Preferences File Behaviour

More
01 Dec 2020 06:57 - 01 Dec 2020 07:50 #190741 by phillc54
I have some strange behaviour when saving/loading preferences. I have the following functions in a module:

Warning: Spoiler!

The reload function is called on startup and behaves correctly for both True and False.

After startup if the reload function is called then it behaves correctly.

After the save funcion is called, the Origin in the prefs file correctly reflects the state. Then when reload is called it gives a message in the terminal 'bool' object has no attribute 'lower' and the Origin in the preference file is always set to False as is the parent.origin variable.

Warning: Spoiler!

All float, int and str preferences work correctly.

EDIT:
I converted the lines to the below and it works correctly:

Warning: Spoiler!


EDIT 2: I should also add that I have several other bool preferences that are only loaded at startup and saved at shutdown and they all behave correctly.
Last edit: 01 Dec 2020 07:50 by phillc54.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
02 Dec 2020 03:28 #190833 by cmorley
Replied by cmorley on topic Preferences File Behaviour
I'll try to look into this soon. Is this with python3?

Please Log in or Create an account to join the conversation.

More
02 Dec 2020 03:56 #190837 by phillc54
Replied by phillc54 on topic Preferences File Behaviour
Yes, but I haven't tried on python2. Not a big issue as the workaround does work well. If I get a chance today I will try on python2.

Please Log in or Create an account to join the conversation.

More
02 Dec 2020 05:15 #190839 by phillc54
Replied by phillc54 on topic Preferences File Behaviour
Identical behaviour on python2.

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.071 seconds
Powered by Kunena Forum