Issue with exfoliation weewx 4.1.1 and python3 - I think?

387 views
Skip to first unread message

Mike Thompson

unread,
Jun 4, 2020, 9:14:53 AM6/4/20
to weewx-user
Hi Fourm & Matt,

I'm getting an issue with exfoliation to do with data types the message in the log is  "Reason: '>' not supported between instances of 'NoneType' and 'int'"

I've just migrated from 3.9.1 on RPI Ib running Wheezy.
Upgraded to 3.9.1 on RPI 1B running Buster with Python 2. All was working OK
Upgraded to 4.1.1 on Python3 and the issue occurred.
As apart of the upgrade to 4.1.1 on Python3 I had to make changes to alarm.py etc to update python2 code to python3
Installed latest exfoliation (0.45)  and forecast (3.4.0b1) extensions. It looks like exfoliation has over written my customisations so I think it's "out of the box"

Seasons is working - pages and graphs generate OK.
Forecast seems to be working. Sample pages generated OK, most without data but UK met office data on forecast-periods page. Time stamp on files in public_html/forecast are recent i.e post upgrade.
Some Exfoliation pages are generated OK and some not, index and forecast are not but history, almanac and links are.

From syslog it looks like get_windspeed_trend is causing the issue
Jun  4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'TypeError'>'
Jun  4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/exfoliation/index.html.tmpl
Jun  4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** Reason: '>' not supported between instances of 'str' and 'int'
Jun  4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Jun  4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 322, in generate
Jun  4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Jun  4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_exfoliation_index_html_tmpl.py", line 1292, in respond
Jun  4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_exfoliation_index_html_tmpl.py", line 497, in __errorCatcher43
Jun  4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****    File "<string>", line 1, in <module>
Jun  4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_exfoliation_index_html_tmpl.py", line 187, in get_windspeed_trend
Jun  4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****  TypeError: '>' not supported between instances of 'str' and 'int'
from index.html.tmpl;
#def get_windspeed_trend($x)
#if $x > 0
      &#8679;
#elif $x < 0
      &#8681;
#end if
#end def

I'm also seeing;

Jun  4 13:01:32 weepi /weewxd: forecast: ReportThread: _get_stats: '>' not supported between instances of 'NoneType' and 'float'

around 50 of them followed by
Jun  4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'TypeError'>'
Jun  4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/exfoliation/forecast.html.tmpl
Jun  4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** Reason: '>' not supported between instances of 'NoneType' and 'int'
Jun  4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Jun  4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 322, in generate
Jun  4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Jun  4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_exfoliation_forecast_html_tmpl.py", line 384, in respond
Jun  4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1707, in _handleCheetahInclude
Jun  4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Jun  4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_exfoliation_forecast_table_inc.py", line 538, in respond
Jun  4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: ****  TypeError: '>' not supported between instances of 'NoneType' and 'int'


It may have something to do with changes and extensions I've made over the years. To be fair, I've just bumped along working this out from first principles until it worked so it's highly likely I've not implemented changes correctly
From my weewx.conf the only section regarding exfoliation is;
    [[exfoliation]]
        HTML_ROOT = public_html/exfoliation
        skin = exfoliation
        #radar_local_img = http://radar.weather.gov/ridge/lite/N0R/BOX_loop.gif
        #radar_regional_img = http://radar.weather.gov/ridge/Conus/Loop/northeast_loop.gif
        #radar_national_img = http://images.intellicast.com/WxImages/Radar/usa.gif

        # MT Addition for forecast and alltime,sevenday
        [[[CheetahGenerator]]]
            search_list_extensions = user.forecast.ForecastVariables, user.stats.MyStats

I've run with exfoliation commented out in weewx.conf as well as enabled=false and weewx is running without error

Syslog attached.
before 09:35 I was running 3.9.1 on Python 2
after 09:35 4.1.1 on python 3
post 12:36:37 debug is turned on

Thanks in Advance
syslog2

Mike Thompson

unread,
Jun 6, 2020, 6:15:47 AM6/6/20
to weewx-user
I've had some time to investigate it's the forecast extension that's upsetting things.
Had anyone else had this issue?

Scott Weis

unread,
Jul 11, 2020, 5:51:22 PM7/11/20
to weewx...@googlegroups.com

I’m having the exact same issue

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/3f339541-107d-4791-85be-7c658b0d180co%40googlegroups.com.

Tom Keffer

unread,
Jul 11, 2020, 6:08:01 PM7/11/20
to weewx-user
For the first error, in file index.html.tmpl, line 226, change this

#if $varExists('trend') and $trend.windSpeed.raw is not None
      $get_windspeed_trend($trend.windSpeed.formatted)
#end if

to this

#if $varExists('trend') and $trend.windSpeed.raw is not None
      $get_windspeed_trend($trend.windSpeed.raw)
#end if

For the second error, there are a number of candidates that could be causing this problem. I'd go with this one. Change this

#if $show_pop
        <td class='col-pop'>
  #if $period.pop.raw > 0
          $period.pop.format('%.0f',' ')
  #end if
<br/>
  #if $period.qpf.raw > 0
          $period.qpf.nolabel('%.2f',' ') <img class='pop-img' src='icons/raindrop.png' />
  #end if
<br/>
  #if $period.qsf.raw > 0
          $period.qsf.nolabel('%.2f',' ') <img class='pop-img' src='icons/snowflake.png' />
  #end if
        </td>
#end if

to this

#if $show_pop
        <td class='col-pop'>
  #if $period.pop.raw is not None and $period.pop.raw > 0
          $period.pop.format('%.0f',' ')
  #end if
<br/>
  #if $period.qpf.raw is not None and $period.qpf.raw > 0
          $period.qpf.nolabel('%.2f',' ') <img class='pop-img' src='icons/raindrop.png' />
  #end if
<br/>
  #if $period.qsf.raw is not None and $period.qsf.raw > 0
          $period.qsf.nolabel('%.2f',' ') <img class='pop-img' src='icons/snowflake.png' />
  #end if
        </td>
#end if

But I could be wrong on that.

-tk


--
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+...@googlegroups.com.

Scott Weis

unread,
Jul 11, 2020, 6:23:13 PM7/11/20
to weewx...@googlegroups.com

I changed the first one and all my errors went away.  I’m not sure I was having the second part of the error.

 

 

Thanks,

Scott KB2EAR

http://weather.kb2ear.net/exfoliation

Timothy Buchanan

unread,
Sep 3, 2020, 3:20:22 PM9/3/20
to weewx-user
I have a similar problem with python3 and extension. The index and history pages are being generated. I made the first change listed above, but my index template doesn't have a show_pop. Here is the syslog extract:


Sep  3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'TypeError'>'
Sep  3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/exfoliation/index.html.tmpl
Sep  3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** Reason: '>' not supported between instances of 'NoneType' and 'int'
Sep  3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Sep  3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 322, in generate
Sep  3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Sep  3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: ****    File "cheetah__etc_weewx_skins_exfoliation_index_html_tmpl_1599160522_6806855_35363.py", line 1380, in respond
Sep  3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: ****  TypeError: '>' not supported between instances of 'NoneType' and 'int'
Sep  3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'TypeError'>'
Sep  3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/exfoliation/forecast.html.tmpl
Sep  3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** Reason: '>' not supported between instances of 'NoneType' and 'int'
Sep  3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Sep  3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 322, in generate
Sep  3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Sep  3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_exfoliation_forecast_html_tmpl.py", line 384, in respond
Sep  3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1707, in _handleCheetahInclude
Sep  3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Sep  3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_exfoliation_forecast_table_inc.py", line 530, in respond
Sep  3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: ****  TypeError: '>' not supported between instances of 'NoneType' and 'int

John Kline

unread,
Sep 3, 2020, 4:44:53 PM9/3/20
to weewx...@googlegroups.com
I did a quick port of exfoliation for someone who wanted to get it to work with WeeWX 4/Py3.

You are welcome to try it:

If you want it to work with the forecast plugin, I have that working with WeeWX4/Py3 at:


On Sep 3, 2020, at 12:20 PM, Timothy Buchanan <timothye...@gmail.com> wrote:

I have a similar problem with python3 and extension. The index and history pages are being generated. I made the first change listed above, but my index template doesn't have a show_pop. Here is the syslog extract:

Timothy Buchanan

unread,
Sep 3, 2020, 5:01:54 PM9/3/20
to weewx-user
Thanks, that port does work, and forecast already worked. My skin is modified from exfoliation, so what I'd like to know is what lines had to be changed in the templates to make it work with python3?

John Kline

unread,
Sep 3, 2020, 6:16:01 PM9/3/20
to weewx...@googlegroups.com
> what I'd like to know is what lines had to be changed in the templates to make it work with python3?

You can see exactly what I changed here:

On Sep 3, 2020, at 2:01 PM, Timothy Buchanan <timothye...@gmail.com> wrote:

Thanks, that port does work, and forecast already worked. My skin is modified from exfoliation, so what I'd like to know is what lines had to be changed in the templates to make it work with python3?

Timothy Buchanan

unread,
Sep 3, 2020, 7:55:50 PM9/3/20
to weewx-user
Thanks! Those changes fixed all. You can see my pi weather server at  http://millennialhouse.ddns.net/wx/  
Reply all
Reply to author
Forward
0 new messages