Oh, I forgot to add, if you add the following to skins/Standard/skins.conf, the 
problem goes away:
[Foo]
    [[Bar]]
        x = 1

It appears the introduction of new sections is a problem when using 
configobj.write

Cheers,
John

> On Jul 14, 2020, at 9:15 AM, John Kline <[email protected]> wrote:
> 
> Hi Tom,
> 
> I had a chance to dig deeper into the issues I am seeing at head, 
> specifically the weeutil.config.deep_copy function.
> 
> I would appreciate it if you could could try to reproduce the problem with 
> this StandardReport.  Just run wee_reports (there’s no need to restart WeeWX):
> 
>    [[StandardReport]]                                 
>        # This is the old "Standard" skin. By default, it is not enabled.
>        skin = Standard
>        enable = true
>        [[[Foo]]]
>           [[[[Bar]]]]
>                baz = foobarabaz
> 
> If it fails for you, and iff this is legal to have in the weewx.conf file, 
> you can instrument the function to see why it happens by adding this to the 
> code below to the beginning.  You see it fail when running wee_reports and 
> know which tmp file to look in.  Again, just run wee_reports.
> 
>    import time                                                                
>                                                                               
>              
>    fname = '/tmp/config_obj_%f' % time.time()                                 
>                                               print('writing %s' % fname)     
>                                                                               
>                         fd = open(fname, 'wb')                                
>                                                                               
>    old_dict.write(fd)                                                         
>                                                                   fd.close()  
>                                                                               
>                                                          print('done writing 
> %s' % fname)                                                                  
>                                print('reading %s' % fname)                    
>                                                                               
>        fd = open(fname, 'rb')                                                 
>                                                                   new_dict = 
> configobj.ConfigObj(fd,                                                       
>                                                                      
> encoding='utf8',                                                              
>                                                               
> default_encoding=old_dict.default_encoding,                                   
>                                          
> interpolation=old_dict.interpolation)                                         
>                   fd.close()                                                  
>                                                                               
>          print('done reading %s' % fname)                                     
>                                                           return new_dict
> 
> If this isn’t legal, I’ll need to change [my copy] of forecast as I believe 
> this is a typical report entry for reports that include a forecast:
> 
>        [[[Extras]]]
>            [[[[forecast_iconic_settings]]]]
>                source = NWS
>                orientation = horizontal
>                num_days = 7
>                bar_size = 150
>                show_date = 0
>                show_pop = 0
>                show_precip = 1
>                show_obvis = 1
> 
> The above causes the same issue.
> 
> If you add the instrumentation code and look at the temp file, you’ll see 
> that the sections have the wrong number of brackets.
> 
> Cheers,
> John

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/CA049183-2575-4062-AC9C-A8C96C81A1D5%40johnkline.com.

Reply via email to