Tom, the lines starting at line number 846 in wee_database need to be skipped if records == 0. Not sure how you want to do that and whether you want a summary that says “no records in database”. It will be easier for you to fix than to go back and forth with a PR.
> On Jan 21, 2021, at 12:42 PM, John Kline <j...@johnkline.com> wrote: > > > I had a look. This does not mean the database is bad. The code needs a > small fix as it’s using a variable that isn’t set if there are no records in > the database. > >>> On Jan 21, 2021, at 12:37 PM, S R <sjr426...@gmail.com> wrote: >>> >> >> if i run wee_database -- check on the sdb that was installed during the >> installed, it passes. >> if i rename the original sdb and then run wee_database --create, the file >> creates without error, but if i then immediately run the --check i get the >> below error >> >> sudo wee_database --check >> Using configuration file /etc/weewx/weewx.conf >> Using database binding 'wx_binding', which is bound to database 'weewx' >> Checking daily summary tables version... >> Daily summary tables are at version 3.0 >> Interval Weighting Fix is not required. >> Daily summary tables version check completed in 0.01 seconds. >> Preparing Null String Fix, this may take a while... >> Traceback (most recent call last): >> File "/usr/share/weewx/wee_database", line 1020, in <module> >> main() >> File "/usr/share/weewx/wee_database", line 159, in main >> check(config_dict, db_binding, options) >> File "/usr/share/weewx/wee_database", line 582, in check >> check_strings(config_dict, db_binding, options, fix=False) >> File "/usr/share/weewx/wee_database", line 848, in check_strings >> % (records, timestamp_to_string(record[0])), end=' ') >> UnboundLocalError: local variable 'record' referenced before assignment >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "weewx-user" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to weewx-user+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/weewx-user/50265d72-27cc-4131-b4d7-d62bca674fe7n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/07907469-7084-472A-9D1E-0F81685FD244%40johnkline.com.