TypeError: '<=' not supported between instances of 'int' and 'NoneType'

21 views
Skip to first unread message

Dan'l B

unread,
1:47 PM (6 hours ago) 1:47 PM
to weewx-user
Running 5.2 in a venn on Ubuntu VM in Parallels, with Forecast extension 4 installed and it throws me the following error. I can go look at line 143 but am not sure how to cure the error.

2026-01-18T13:25:31.607940-05:00 ubuntu-gnu-linux-24-04-3 weewxd[14663]: ERROR weewx.cheetahgenerator: ****    File "_home_house_weewx_data_skins_forecast_multiple_tables_html_tmpl.py", line 143, in respond
2026-01-18T13:25:31.607998-05:00 ubuntu-gnu-linux-24-04-3 weewxd[14663]: ERROR weewx.cheetahgenerator: ****    File "/home/house/weewx-venv/lib/python3.12/site-packages/Cheetah/Template.py", line 1712, in _handleCheetahInclude
2026-01-18T13:25:31.608034-05:00 ubuntu-gnu-linux-24-04-3 weewxd[14663]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
2026-01-18T13:25:31.608073-05:00 ubuntu-gnu-linux-24-04-3 weewxd[14663]: ERROR weewx.cheetahgenerator: ****    File "_home_house_weewx_data_skins_forecast_forecast_table_inc.py", line 1178, in respond
2026-01-18T13:25:31.608130-05:00 ubuntu-gnu-linux-24-04-3 weewxd[14663]: ERROR weewx.cheetahgenerator: ****  TypeError: '<=' not supported between instances of 'int' and 'NoneType'

John Kline

unread,
2:33 PM (5 hours ago) 2:33 PM
to weewx...@googlegroups.com, weewx-user
Please skins/forecast/forecast_table.inc with the file attached and let me know how that works out.

forecast_table.inc

Dan Hinckley

unread,
3:15 PM (4 hours ago) 3:15 PM
to weewx...@googlegroups.com
John,

Swapped that in, and we still seem to have the error. Do you need more info from me?

2026-01-18T15:06:01.851681-05:00 ubuntu-gnu-linux-24-04-3 weewxd[24104]: ERROR weewx.cheetahgenerator: ****    File "/home/house/weewx-venv/lib/python3.12/site-packages/weewx/cheetahgenerator.py", line 334, in generate
2026-01-18T15:06:01.851751-05:00 ubuntu-gnu-linux-24-04-3 weewxd[24104]: ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
2026-01-18T15:06:01.851787-05:00 ubuntu-gnu-linux-24-04-3 weewxd[24104]: ERROR weewx.cheetahgenerator: ****                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-18T15:06:01.851843-05:00 ubuntu-gnu-linux-24-04-3 weewxd[24104]: ERROR weewx.cheetahgenerator: ****    File "_home_house_weewx_data_skins_forecast_single_strip_html_tmpl.py", line 110, in respond
2026-01-18T15:06:01.851882-05:00 ubuntu-gnu-linux-24-04-3 weewxd[24104]: ERROR weewx.cheetahgenerator: ****    File "/home/house/weewx-venv/lib/python3.12/site-packages/Cheetah/Template.py", line 1712, in _handleCheetahInclude
2026-01-18T15:06:01.851901-05:00 ubuntu-gnu-linux-24-04-3 weewxd[24104]: ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
2026-01-18T15:06:01.851931-05:00 ubuntu-gnu-linux-24-04-3 weewxd[24104]: ERROR weewx.cheetahgenerator: ****    File "_home_house_weewx_data_skins_forecast_forecast_strip_inc.py", line 978, in respond
2026-01-18T15:06:01.851962-05:00 ubuntu-gnu-linux-24-04-3 weewxd[24104]: ERROR weewx.cheetahgenerator: ****  TypeError: '<' not supported between instances of 'int' and 'NoneType'
2026-01-18T15:06:02.021614-05:00 ubuntu-gnu-linux-24-04-3 weewxd[24104]: DEBUG user.purple: new_loop_packet(Event type: <class 'weewx.NEW_LOOP_PACKET'> | packet: {'dateTime': 1768766761, 'usUnits': 17, 'windSpeed': 0.73, 'windDir': 251})


On Jan 18, 2026, at 14:32, 'John Kline' via weewx-user <weewx...@googlegroups.com> wrote:

Please skins/forecast/forecast_table.inc with the file attached and let me know how that works out.


--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/-67wc9q71UU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/weewx-user/3D7AB7A4-D654-4B30-84D1-103DDF004D2F%40johnkline.com.
<forecast_table.inc>


On Jan 18, 2026, at 10:47 AM, Dan'l B <dan.hi...@gmail.com> wrote:


--
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 visit https://groups.google.com/d/msgid/weewx-user/b96ba5a3-8541-488e-9f9f-0d190618ce1fn%40googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/-67wc9q71UU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/weewx-user/3D7AB7A4-D654-4B30-84D1-103DDF004D2F%40johnkline.com.

p q

unread,
3:26 PM (4 hours ago) 3:26 PM
to weewx...@googlegroups.com
The error is happening because the program is trying compare an empty value with an integer. This was ok in very old python but not in Python 3.x. What you need to do is change the comparison to first check if the variable is none before doing the comparison. If the variable is X, it's something like
if X is not None or X >= 1234:

You can ask Claude or ChatGPT or some other LLM to help with the syntax if you get stuck.




--
Peter Quinn
(415)794-2264

John Kline

unread,
3:57 PM (3 hours ago) 3:57 PM
to weewx...@googlegroups.com, weewx...@googlegroups.com
I sent him a file that checks for on every comparison.


On Jan 18, 2026, at 12:26 PM, p q <peterq...@gmail.com> wrote:



John Kline

unread,
3:59 PM (3 hours ago) 3:59 PM
to weewx...@googlegroups.com, weewx...@googlegroups.com
Actually, you no longer have that error.  This one is in forecast_strip.inc

These values should probably not be None, but the code shouldn’t error on this.  I’ll send you a forecast_strip.inc shortly.

On Jan 18, 2026, at 12:15 PM, Dan Hinckley <d...@suiattle.org> wrote:



John Kline

unread,
4:11 PM (3 hours ago) 4:11 PM
to weewx...@googlegroups.com, weewx...@googlegroups.com
By the way, this isn’t my code, but I seem to be the maintainer of it now.

Dan’l, it would help to know if you have nulls for sun/moon rise/set, or nulls in the tides.  Do you have xtide installed?  Are you trying the new alamanac?

My guess is that $alm.sunrise.raw and friends are None.

If you are using the new almanac, try removing it and see if you still get errors.  Either way, get back to me.

As for xtide, if you are using it, tell me how you installed it.

On Jan 18, 2026, at 12:59 PM, John Kline <jo...@johnkline.com> wrote:



Karen K

unread,
4:26 PM (3 hours ago) 4:26 PM
to weewx-user
John Kline schrieb am Sonntag, 18. Januar 2026 um 22:11:08 UTC+1:
If you are using the new almanac, try removing it and see if you still get errors.  

You can simply set enable=false for it to switch it off and use the original one instead.
 
Reply all
Reply to author
Forward
0 new messages