Bug Python rs.GetSettings?

Hi, there seems to be a bug in rs.GetSettings. The code sample returns:

Message: No section: ‘whatever’

Also ConfigParser.set (rs.SaveSettings) is not supported from utility.py
Looks like the ConfigParser needs some love…

Thanks, Jess

Hi,
Do you mean the code sample here?:
https://developer.rhino3d.com/api/RhinoScriptSyntax/#utility-GetSettings

Can you share the file you’re reading?

Thanks

Hi Alain,

Please find below an example. The script shows a dialog and I can select a section.
No matter which section I select this is the result:

Message: No section: ‘sectionone’
Traceback:
line 279, in options, “C:\Program Files\Rhino 6\Plug-ins\IronPython\Lib\ConfigParser.py”
line 408, in GetSettings, “C:\Users\User\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py”

SampleSettings.ini (175 Bytes)

If you have control over the config file making the sections all lower case would fix your problem.
Logged here
Thanks

1 Like

Thanks Alain,

Yes, but I think I’ll write my own function calls for the ConfigParser since there is also this option: 13.2. ConfigParser — Configuration file parser — Python 2.7.18 documentation

Jess

1 Like