Belchertown Beta 1.1b9 Error

156 views
Skip to first unread message

Gert Andersen

unread,
Mar 12, 2020, 5:23:45 PM3/12/20
to weewx-user
Hi

I have this error:

Mar 12 22:11:24 InterceptorTest wee_reports[6182]: Belchertown Extension: version 1.1b9
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: cheetahgenerator: Generate failed with exception '<type 'exceptions.UnicodeDecodeError'>'
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: cheetahgenerator: **** Ignoring template /etc/weewx/skins/Belchertown/about/index.html.tmpl
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: cheetahgenerator: **** Reason: 'ascii' codec can't decode byte 0xc3 in position 500: ordinal not in range(128)
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: ****  Traceback (most recent call last):
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 332, in generate
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: ****      fd.write(str(compiled_template))
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1045, in __str__
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: ****      rc = getattr(self, mainMethName)()
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: ****    File "_etc_weewx_skins_Belchertown_about_index_html_tmpl.py", line 104, in respond
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1685, in _handleCheetahInclude
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: ****      file=file)
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 772, in compile
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: ****      settings=(compilerSettings or {}))
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Compiler.py", line 1708, in __init__
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: ****      source = unicode(source)
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: ****  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 500: ordinal not in range(128)

Any ideas?

Furthermore I do not get the forecast anymore.

Thanks

Rgds
Gert

vince

unread,
Mar 12, 2020, 6:42:09 PM3/12/20
to weewx-user
On Thursday, March 12, 2020 at 2:23:45 PM UTC-7, Gert Andersen wrote:
Mar 12 22:11:24 InterceptorTest wee_reports[6182]: Belchertown Extension: version 1.1b9
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: cheetahgenerator: Generate failed with exception '<type 'exceptions.UnicodeDecodeError'>'
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: cheetahgenerator: **** Ignoring template /etc/weewx/skins/Belchertown/about/index.html.tmpl
Mar 12 22:11:27 InterceptorTest wee_reports[6182]: cheetahgenerator: **** Reason: 'ascii' codec can't decode byte 0xc3 in position 500: ordinal not in range(128)

For starters, did you edit the index.html.tmpl file mentioned above ?

Gert Andersen

unread,
Mar 12, 2020, 6:52:38 PM3/12/20
to weewx-user
Hi

Thanks for looking.

No, I did not edit the index file.

The only thing I changed was the skin.conf and changed the encoding to utf8 instead of strictly_ascii. This will display danish characters.


[[SummaryByMonth]]
        # Reports that summarize "by month"
        [[[NOAA_month]]]
            encoding = utf8
            template = NOAA/NOAA-YYYY-MM.txt.tmpl

    [[SummaryByYear]]
        # Reports that summarize "by year"
        [[[NOAA_year]]]
            encoding = utf8
            template = NOAA/NOAA-YYYY.txt.tmpl

Gert

Pat

unread,
Mar 13, 2020, 8:59:51 AM3/13/20
to weewx-user
Which version of python?

Gert Andersen

unread,
Mar 13, 2020, 9:39:16 AM3/13/20
to weewx-user
Hi

Version 2.7.16

Gert

Pat

unread,
Mar 13, 2020, 9:41:04 AM3/13/20
to weewx-user
Let me run some tests

Pat

unread,
Mar 13, 2020, 9:46:30 AM3/13/20
to weewx-user
I'm unable to reproduce this. Can you provide a clear example that would allow me to reproduce this?

Also, weewx version 4?
2.jpg

Gert Andersen

unread,
Mar 13, 2020, 9:53:19 AM3/13/20
to weewx-user
Hi Pat

What do you exactly mean by an example?

I haven't tried weewx version 4

This is version 1.0.1 of Belchertown
and version 1.1b9
and no Darksky Forecast

Both running weewx 3.2.9

Gert

Gert Andersen

unread,
Mar 13, 2020, 9:56:12 AM3/13/20
to weewx-user

Pat

unread,
Mar 13, 2020, 9:56:46 AM3/13/20
to weewx-user
Thats helpful. So looking at http://vsvejr.de/reports/ it looks like the reports are generating for today, and I can see danish characters in the report. Which characters are failing the report from generating when you change it to utf8?

Gert Andersen

unread,
Mar 13, 2020, 10:00:33 AM3/13/20
to weewx-user
Hi Pat

You did some changes to the beta version in order to use danishcharacters  and I don't know if this error has something to do with this. Maybe you can't reproduce the error because your not running danish characters?

Gert

On Friday, March 13, 2020 at 2:46:30 PM UTC+1, Pat wrote:

Pat

unread,
Mar 13, 2020, 10:02:19 AM3/13/20
to weewx-user
Well, I've put danish characters into my location name as a test, and they are showing in the report fine (see my screenshot from a few emails ago in the red box). 

Looking at the site you say is broken, it doesn't look broken, so I'm trying to understand what breaks when you use utf8 instead of strict_ascii?

Gert Andersen

unread,
Mar 13, 2020, 10:04:31 AM3/13/20
to weewx-user
Hi

The utf8 is for the NOAA reports with strict_ascii i have Smarken instead instead of Sømarken in the heading.

Gert

Pat

unread,
Mar 13, 2020, 10:06:17 AM3/13/20
to weewx-user
I can see Sømarken when I view it....? See photo attached
3.jpg

Gert Andersen

unread,
Mar 13, 2020, 10:06:38 AM3/13/20
to weewx-user
Hi Pat

I'm missing the forecast and I have:
forecast_enabled = 1
in weewx.conf.

Gert


On Friday, March 13, 2020 at 3:02:19 PM UTC+1, Pat wrote:

Andrew Milner

unread,
Mar 13, 2020, 10:08:12 AM3/13/20
to weewx-user
I have Vester Somarken (with the danish character) in the header when I view your site.

Gert Andersen

unread,
Mar 13, 2020, 10:08:25 AM3/13/20
to weewx-user
Hi

Yes, that's because i have encoding = utf8, If I don't change to utf8 I'll have Smarken

Gert

Pat

unread,
Mar 13, 2020, 10:08:35 AM3/13/20
to weewx-user
Your forecast is missing because of a server error on your side. 


It will give you error 403 which is a Forbidden error on your web server

Andrew Milner

unread,
Mar 13, 2020, 10:11:07 AM3/13/20
to weewx-user
It appears to be correct on both the normal HTML pages and also the NOAA climatological summary pages




normal 

Gert Andersen

unread,
Mar 13, 2020, 10:11:09 AM3/13/20
to weewx-user
Hi

Does this also relate to the error I have #1?

Gert

Pat

unread,
Mar 13, 2020, 10:13:27 AM3/13/20
to weewx-user
No your error in #1 is related to the NOAA reports. Your 403 error is something on your web server outside of weewx or Belchertown.


I'm still confused here:

When strict_ascii you get the error?

When using utf8 it is Sømarken?

Gert Andersen

unread,
Mar 13, 2020, 10:21:37 AM3/13/20
to weewx-user
Hi Pat

I try to be more clear. When I use Belchertown out of the box (strict_ascii) in skin.conf, my heading will show Smarken. No errors in the log just wrong heading. When I set encoding to utf8, my heading is correct Sømarken. I have been using utf8 with version 1.0.1 for a long time without any errors. An example here is:
sevejret.dk, which is version 1.0.1 of Belchertown.

Sorry for the confusion.

BTW, any ideas about the 403 error. Permission?

Gert

Gert Andersen

unread,
Mar 13, 2020, 10:23:45 AM3/13/20
to weewx-user
Hi Pat

I can try to change back to strict_ascii and see if the error persist.

Gert

On Friday, March 13, 2020 at 3:13:27 PM UTC+1, Pat wrote:

Pat

unread,
Mar 13, 2020, 10:28:05 AM3/13/20
to weewx-user
Oh, you can leave it as utf8 - if that works for you then stay with that configuration. That's why it exists. 

I thought you meant utf8 was broken. 

On the 403 error.... hmm, you'd have to check the nginx logs to see why it may be restricting access to that file.

Gert Andersen

unread,
Mar 13, 2020, 10:33:22 AM3/13/20
to weewx-user
Hi

Just reverted back to strict_ascii and as you can see from the NOAA report, the heading now is Smarken. 

Still the same error as in #1

Gert

On Friday, March 13, 2020 at 3:13:27 PM UTC+1, Pat wrote:

Pat

unread,
Mar 13, 2020, 10:35:22 AM3/13/20
to weewx-user
I see that now. I advise you to keep it as utf8 since that is working for you.

Gert Andersen

unread,
Mar 13, 2020, 10:45:41 AM3/13/20
to weewx-user
Hi Pat

Just looked at the permission for darksky json and changed it. Now it seems that the forecast is ok. Thanks for pointing me in that direction.

Now I "just" have the error in #1

Gert

On Friday, March 13, 2020 at 3:08:35 PM UTC+1, Pat wrote:

Pat

unread,
Mar 13, 2020, 10:48:05 AM3/13/20
to weewx-user
The error in #1 is resolved. Leave the setting as utf8.

Gert Andersen

unread,
Mar 13, 2020, 10:59:39 AM3/13/20
to weewx-user
Hi Pat

I still have this from syslog and the last archive  Should I just ignore it?

ar 13 15:55:23 InterceptorTest weewx[1933]: cheetahgenerator: Generate failed with exception '<type 'exceptions.UnicodeDecodeError'>'
Mar 13 15:55:23 InterceptorTest weewx[1933]: cheetahgenerator: **** Ignoring template /etc/weewx/skins/Belchertown/about/index.html.tmpl
Mar 13 15:55:23 InterceptorTest weewx[1933]: cheetahgenerator: **** Reason: 'ascii' codec can't decode byte 0xc3 in position 500: ordinal not in range(128)
Mar 13 15:55:23 InterceptorTest weewx[1933]: ****  Traceback (most recent call last):
Mar 13 15:55:23 InterceptorTest weewx[1933]: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 332, in generate
Mar 13 15:55:23 InterceptorTest weewx[1933]: ****      fd.write(str(compiled_template))
Mar 13 15:55:23 InterceptorTest weewx[1933]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1045, in __str__
Mar 13 15:55:23 InterceptorTest weewx[1933]: ****      rc = getattr(self, mainMethName)()
Mar 13 15:55:23 InterceptorTest weewx[1933]: ****    File "_etc_weewx_skins_Belchertown_about_index_html_tmpl.py", line 104, in respond
Mar 13 15:55:23 InterceptorTest weewx[1933]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1685, in _handleCheetahInclude
Mar 13 15:55:23 InterceptorTest weewx[1933]: ****      file=file)
Mar 13 15:55:23 InterceptorTest weewx[1933]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 772, in compile
Mar 13 15:55:23 InterceptorTest weewx[1933]: ****      settings=(compilerSettings or {}))
Mar 13 15:55:23 InterceptorTest weewx[1933]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Compiler.py", line 1708, in __init__
Mar 13 15:55:23 InterceptorTest weewx[1933]: ****      source = unicode(source)
Mar 13 15:55:23 InterceptorTest weewx[1933]: ****  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 500: ordinal not in range(128)

Thanks

Gert

Pat

unread,
Mar 13, 2020, 11:01:52 AM3/13/20
to weewx-user
So this is a new error :) 

Did you change the about/index.html file? Or does your about.inc have danish characters? I assume yes. The about/index.html.tmpl should be converting those but maybe there is an issue with the about.inc. Can you attach it?

Pat

unread,
Mar 13, 2020, 11:03:01 AM3/13/20
to weewx-user
Ah, this isn't a new error... *this* is your issue #1. I thought the NOAA issue was issue #1. I was confused but I think I am better now. 

Gert Andersen

unread,
Mar 13, 2020, 11:10:42 AM3/13/20
to weewx-user
Hi

Here is the file

Gert
index.html.tmpl

Pat

unread,
Mar 13, 2020, 11:12:00 AM3/13/20
to weewx-user
Can you attach your about.inc?

Gert Andersen

unread,
Mar 13, 2020, 11:39:44 AM3/13/20
to weewx-user
Hi

Here it is

Gert
about.inc

Pat

unread,
Mar 13, 2020, 12:50:11 PM3/13/20
to weewx-user
Add this to the top of your about.inc

#encoding UTF-8

Gert Andersen

unread,
Mar 13, 2020, 4:20:03 PM3/13/20
to weewx-user
Hi Pat

Issue solved. Thanks again for your support.

Gert
Reply all
Reply to author
Forward
0 new messages