Re: [weewx-user] Belchertown skin error after upgrading to 5.2

126 views
Skip to first unread message

Tom Keffer

unread,
Oct 18, 2025, 10:05:48 AM (4 days ago) Oct 18
to weewx...@googlegroups.com
Yes. The function format.locale() was deprecated in Python 3.7, then removed in Python 3.12. It usually can be replaced with locale.format_string().

On Sat, Oct 18, 2025 at 1:15 AM Kevin Key <kevi...@gmail.com> wrote:
Any idea as to what is causing this?

(base) kevin@linux:/var/www/html/weewx$ sudo weectl report run
Using configuration file /etc/weewx/weewx.conf
All enabled reports will be run.
Generating as of last timestamp in the database.
Traceback (most recent call last):
  File "/usr/share/weewx/weewx/reportengine.py", line 248, in run
    obj.start()
  File "/usr/share/weewx/weewx/reportengine.py", line 465, in start
    self.run()
  File "/usr/share/weewx/weewx/cheetahgenerator.py", line 166, in run
    ngen = self.generate(gen_dict[section_name], section_name, self.gen_ts)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/weewx/weewx/cheetahgenerator.py", line 226, in generate
    ngen += self.generate(section[subsection], subsection, gen_ts)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/weewx/weewx/cheetahgenerator.py", line 226, in generate
    ngen += self.generate(section[subsection], subsection, gen_ts)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/weewx/weewx/cheetahgenerator.py", line 309, in generate
    searchList = self._getSearchList(encoding, timespan,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/weewx/weewx/cheetahgenerator.py", line 401, in _getSearchList
    search_list += obj.get_extension_list(timespan, db_lookup)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/etc/weewx/bin/user/belchertown.py", line 612, in get_extension_list
    locale.format("%g", float(year_outTemp_max_range_total)),
    ^^^^^^^^^^^^^
AttributeError: module 'locale' has no attribute 'format'. Did you mean: '_format'?
Done.
(base) kevin@linux:/var/www/html/weewx$

--
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/ebefede5-5eb6-4882-ace6-c26b6330a6c5n%40googlegroups.com.

Tim Tuck

unread,
Oct 21, 2025, 1:02:28 AM (yesterday) Oct 21
to weewx...@googlegroups.com

I had that same error and added ...

locale.format = locale.format_string

to 

/etc/weewx/bin/user/belchertown.py

and while the errors have gone away, the skin's ability to receive mqtt traffic has failed but with no obvious error in logs.

The page still updates according to its refresh schedule so there that, but it would be nice to get mqtt happening again.

Any pointers appreciated.

thanks

Tim

mh081...@gmail.com

unread,
Oct 21, 2025, 3:09:11 AM (yesterday) Oct 21
to weewx-user
You should consider to install the forked Version of Belchertown skin on  https://github.com/uajqq/weewx-belchertown-new. The original Repo hasn't been maintained for quite a while now, so this fork will attempt to keep up with bug fixes and new features. 
I don't have your issues with this Version 1.4. Please install the latest Master Version.Not the Version from July 2025, It has the latest Bugfixes.

Pablo Sanchez

unread,
Oct 21, 2025, 10:00:36 AM (yesterday) Oct 21
to weewx...@googlegroups.com
Tim, if you go with the Master Version, make sure to apply PR 24 - https://github.com/uajqq/weewx-belchertown-new/pull/24

You can hand-edit .../Belchertown/style.css and apply the change. It is easy.

At the moment, I am finalizing a couple of items before I submit my PR:

Thx!

What is a PR?

A PR is short for a pull-request. It is how people can contribute to a Git-based project.

---
pablo

--
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.

Tim Tuck

unread,
Oct 21, 2025, 7:32:22 PM (19 hours ago) Oct 21
to weewx...@googlegroups.com

Brilliant - thanks for that.

Is there an upgrade path from the old one to the new or do I have to remove the old one first ?

I have a bunch of customisations and it would be nice to not need to redo them again.

thanks

Tim

--
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.
Reply all
Reply to author
Forward
0 new messages