Well, if the error went away when you replaced the seasons directory, it must have been in the templates. Your error is typical of templates missing the #encoding directive.
The other possibility, that the encoding option was wrong in skin.conf, would not cause this error. Instead, the Cheetah engine would have just quietly ignored the spanish characters. -tk On Tue, Sep 24, 2019 at 5:52 AM Kike .Asekas <[email protected]> wrote: > Thank you. The file have #encoding UTF-8. I remove the seasons folder and > it copy from github. I change weewx.conf labels to spanish with spanish > characters and I don't have errors now. I don't know where was the fault. > > El martes, 24 de septiembre de 2019, 14:47:45 (UTC+2), Thomas Keffer > escribió: >> >> The problem is almost surely in the file >> /etc/weewx/skins/Seasons/index.html.tmpl. Double check that the top of >> the file include a #encoding directive: >> >> ## Copyright 2009-2018 Tom Keffer, Matthew Wall >> ## Distributed under terms of GPLv3. See LICENSE.txt for your rights. >> #errorCatcher Echo >> ## >> ## Specifying an encoding of UTF-8 is usually safe: >> #encoding UTF-8 >> ## >> <!DOCTYPE html> >> >> If it does, send me privately your copy of >> /etc/weewx/skins/Seasons/index.html.tmpl, >> /etc/weewx/skins/Seasons/skin.conf, and /etc/weewx/weewx.conf and I will >> see if I can replicate the error. Obfuscate any passwords in weewx.conf. >> >> -tk ([email protected]) >> >> >> On Tue, Sep 24, 2019 at 5:09 AM Kike .Asekas <[email protected]> wrote: >> >>> cheetahgenerator: Generate failed with exception '<type >>> 'exceptions.UnicodeDecodeError'>' >>> Sep 24 14:05:27 raspberrypi weewx[27767]: cheetahgenerator: **** >>> Ignoring template /etc/weewx/skins/Seasons/index.html.tmpl >>> Sep 24 14:05:27 raspberrypi weewx[27767]: cheetahgenerator: **** Reason: >>> 'ascii' codec can't decode byte 0xc3 in position 1815: ordinal not in >>> range(128) >>> Sep 24 14:05:27 raspberrypi weewx[27767]: **** Traceback (most recent >>> call last): >>> Sep 24 14:05:27 raspberrypi weewx[27767]: **** File >>> "/usr/share/weewx/weewx/cheetahgenerator.py", line 332, in generate >>> Sep 24 14:05:27 raspberrypi weewx[27767]: **** >>> fd.write(str(compiled_template)) >>> Sep 24 14:05:27 raspberrypi weewx[27767]: **** File >>> "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1045, in >>> __str__ >>> Sep 24 14:05:27 raspberrypi weewx[27767]: **** rc = getattr(self, >>> mainMethName)() >>> Sep 24 14:05:27 raspberrypi weewx[27767]: **** File >>> "_etc_weewx_skins_Seasons_index_html_tmpl.py", line 216, in respond >>> Sep 24 14:05:27 raspberrypi weewx[27767]: **** File >>> "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1685, in >>> _handleCheetahInclude >>> Sep 24 14:05:27 raspberrypi weewx[27767]: **** file=file) >>> Sep 24 14:05:27 raspberrypi weewx[27767]: **** File >>> "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 772, in compile >>> Sep 24 14:05:27 raspberrypi weewx[27767]: **** >>> settings=(compilerSettings or {})) >>> Sep 24 14:05:27 raspberrypi weewx[27767]: **** File >>> "/usr/lib/python2.7/dist-packages/Cheetah/Compiler.py", line 1708, in >>> __init__ >>> Sep 24 14:05:27 raspberrypi weewx[27767]: **** source = >>> unicode(source) >>> Sep 24 14:05:27 raspberrypi weewx[27767]: **** UnicodeDecodeError: >>> 'ascii' codec can't decode byte 0xc3 in position 1815: ordinal not in >>> range(128) >>> >>> >>> El martes, 24 de septiembre de 2019, 13:49:13 (UTC+2), Thomas Keffer >>> escribió: >>>> >>>> It sure would help if you showed us the log... >>>> >>>> On Tue, Sep 24, 2019 at 4:27 AM Kike .Asekas <[email protected]> wrote: >>>> >>>>> I sorry. I don't know where is the problem. I remove all spanish >>>>> characters from skin.conf, index.html.tmpl and weewx.conf and I remove the >>>>> template and copy it again from the git repository and the error >>>>> continues. >>>>> >>>>> El martes, 24 de septiembre de 2019, 12:54:09 (UTC+2), Kike .Asekas >>>>> escribió: >>>>>> >>>>>> I think is in skin.conf. I remove all spanish characters in the >>>>>> template and the error continues. The template is index.html.tmpl >>>>>> >>>>>> El lunes, 23 de septiembre de 2019, 23:02:45 (UTC+2), Thomas Keffer >>>>>> escribió: >>>>>>> >>>>>>> Is there error from a Spanish character in the template, or in >>>>>>> skin.conf, or weewx.conf? >>>>>>> >>>>>>> Which template? >>>>>>> >>>>>>> Please include the log. >>>>>>> >>>>>>> -tk >>>>>>> >>>>>>> On Mon, Sep 23, 2019 at 10:46 AM Kike .Asekas <[email protected]> >>>>>>> wrote: >>>>>>> >>>>>>>> I get this error when I try using spanish characters (ñ,á,é,í,ó,ú). >>>>>>>> I have #encoding UTF-8 in each page althougnt I get the error in a page >>>>>>>> only and i have encoding = utf8 in [CheetahGenerator] in skin.conf. >>>>>>>> >>>>>>>> -- >>>>>>>> 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 [email protected]. >>>>>>>> To view this discussion on the web visit >>>>>>>> https://groups.google.com/d/msgid/weewx-user/1b478f7f-8c11-41f5-93dd-24bee5f39ff0%40googlegroups.com >>>>>>>> <https://groups.google.com/d/msgid/weewx-user/1b478f7f-8c11-41f5-93dd-24bee5f39ff0%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>>>> . >>>>>>>> >>>>>>> -- >>>>> 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 [email protected]. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/weewx-user/9b51bca4-22ac-4a2e-8525-2ada1ad7537e%40googlegroups.com >>>>> <https://groups.google.com/d/msgid/weewx-user/9b51bca4-22ac-4a2e-8525-2ada1ad7537e%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> >>>> -- >>> 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 [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/weewx-user/3d534392-8fea-4c0b-b357-d63126010a1f%40googlegroups.com >>> <https://groups.google.com/d/msgid/weewx-user/3d534392-8fea-4c0b-b357-d63126010a1f%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/weewx-user/0e7b929a-9017-4b60-bca1-62f65a265957%40googlegroups.com > <https://groups.google.com/d/msgid/weewx-user/0e7b929a-9017-4b60-bca1-62f65a265957%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zEBYg6i9cu8pFh-OjgxERFgWzqJ5DQ-butawBTVDLJ3RgQ%40mail.gmail.com.
