It's looking for the unit_system section in your weewx.conf file.
In the default weewx.conf for Weewx 4.10.2 it appears as follows...
[StdReport]
[...]
[[Defaults]]
[...]
unit_system = us
Do you have an entry for unit_system in your weewx.conf file?
If it's missing, then put one in and see if that fixes that hiccup
(and I'll rethink if that's the best place to discover the
unit_system, or what to do if it goes missing)
Which leads to...
What version of weewx are you running,
What's the version of wxtoot.py (at line 177)
Have you edited the weewx.conf file and removed that entry?
> Also the parameter: server_url_mastodon = 'replace_me' confuses me. What is
> this exactly?
See the README, but to recap, it is as follows.
You are going to post to a Mastodon server. It lives somewhere and has
an address.
So, which one? What is its address? URL, IP?
That information replaces the place-holder 'replace_me' within your
weewx.conf file, as follows.
[StdRESTful]
[...]
[Mastodon]
[...]
server_url_mastodon = 'replace_me'
You will also need a 'key_access_token' which you can only get by
following the instructions on that server. It's available from your
account there.
Review the README.md , in particular the last section, after 'Options'
https://github.com/glennmckechnie/weewx-mastodon
If you are still having problems then attach the log and a sanitised
(password free) copy of weewx.conf to your next post, or send it
directly to me.