Belchertown skin error: module 'locale' has no attribute 'format'

63 views
Skip to first unread message

Dan Hinckley

unread,
Dec 31, 2024, 2:51:46 PM12/31/24
to weewx...@googlegroups.com
Running latest Belchertown skin, in a Kali Linux VM, fully updated, running in Paralells on a Mac mini M1

WeeWx 5.1 running in a venv.

The Seasons skin works fine, but enabling the Btown skin causes this error. I removed the skin and re-installed a clean version.

I can do a full startup log report if required but I thought perhaps someone could spot what might be the cause of this error.

Line 612 in belchertown.py is:

# Replace the SQL Query output with the converted values
year_outTemp_range_max = [
year_outTemp_max_range_query[0],
---> locale.format("%g", float(year_outTemp_max_range_total)),
locale.format("%g", float(year_outTemp_max_range_min)),
locale.format("%g", float(year_outTemp_max_range_max)),
]
else:
year_outTemp_range_max = [
calendar.timegm(time.gmtime()),
locale.format("%.1f", 0),
locale.format("%.1f", 0),
locale.format("%.1f", 0),

Log error:

Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: Caught unrecoverable exception in generator 'weewx.cheetahgenerator.CheetahGenerator'
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** module 'locale' has no attribute 'format'
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** Traceback (most recent call last):
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** File "/home/house/weewx-venv/lib/python3.12/site-packages/weewx/reportengine.py", line 248, in run
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** obj.start()
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** File "/home/house/weewx-venv/lib/python3.12/site-packages/weewx/reportengine.py", line 465, in start
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** self.run()
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** File "/home/house/weewx-venv/lib/python3.12/site-packages/weewx/cheetahgenerator.py", line 166, in run
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** ngen = self.generate(gen_dict[section_name], section_name, self.gen_ts)
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** File "/home/house/weewx-venv/lib/python3.12/site-packages/weewx/cheetahgenerator.py", line 226, in generate
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** ngen += self.generate(section[subsection], subsection, gen_ts)
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** File "/home/house/weewx-venv/lib/python3.12/site-packages/weewx/cheetahgenerator.py", line 226, in generate
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** ngen += self.generate(section[subsection], subsection, gen_ts)
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** File "/home/house/weewx-venv/lib/python3.12/site-packages/weewx/cheetahgenerator.py", line 309, in generate
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** searchList = self._getSearchList(encoding, timespan,
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** File "/home/house/weewx-venv/lib/python3.12/site-packages/weewx/cheetahgenerator.py", line 401, in _getSearchList
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** search_list += obj.get_extension_list(timespan, db_lookup)
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** File "/home/house/weewx-data/bin/user/belchertown.py", line 612, in get_extension_list
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** locale.format("%g", float(year_outTemp_max_range_total)),
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** ^^^^^^^^^^^^^
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** AttributeError: module 'locale' has no attribute 'format'. Did you mean: '_format'?
Dec 31 14:40:18 kali-linux-2024-2 weewxd[1021]: ERROR weewx.reportengine: **** Generator terminated



vince

unread,
Dec 31, 2024, 3:19:44 PM12/31/24
to weewx-user
Your Belchertown version needs updating.  Pat made that fix last summer.
Reply all
Reply to author
Forward
0 new messages