cheetah error a/ upgrade to v4.0.0b9 commit a85e320c

150 views
Skip to first unread message

P Simmons

unread,
Jan 22, 2020, 9:04:25 PM1/22/20
to weewx-user
Howdy! I had no problems using v4.0.0b6 but decided to upgrade to v4.0.0b9.

I'm now having problems with report generation.

Here are my (sanitized) conf and log files.

Thank you,
Paul

wee-debug.2019-01-22.txt
weewx-2019-01-22.log

Thomas Keffer

unread,
Jan 22, 2020, 9:20:57 PM1/22/20
to weewx-user
Thanks, Paul

Could you temporarily replace your copy of units.py with the attached? It will log some clues about what's causing the decode error.



--
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 on the web visit https://groups.google.com/d/msgid/weewx-user/09a70440-5968-43ba-a1ef-6ee23306f2d2%40googlegroups.com.
units.py

gjr80

unread,
Jan 22, 2020, 9:44:34 PM1/22/20
to weewx-user
Hmm, noticed the same error on my 4.0/python 2 VM. All was fine around 10am my time on 20 January and the error is there 9am on 21 January. This VM is not run continuously but shutdown at night and started each time it's needed. The first thing after startup is a git pull from development. When I look at the commits since 18-19 January I don't see many (and most are mine :( ), though none seem contentious. Will be interesting to see the cause.

Gary

On Thursday, 23 January 2020 12:20:57 UTC+10, Thomas Keffer wrote:
Thanks, Paul

Could you temporarily replace your copy of units.py with the attached? It will log some clues about what's causing the decode error.



On Wed, Jan 22, 2020 at 6:04 PM P Simmons <mbat...@gmail.com> wrote:
Howdy! I had no problems using v4.0.0b6 but decided to upgrade to v4.0.0b9.

I'm now having problems with report generation.

Here are my (sanitized) conf and log files.

Thank you,
Paul

--
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...@googlegroups.com.

P Simmons

unread,
Jan 22, 2020, 10:01:47 PM1/22/20
to weewx-user


On Wednesday, January 22, 2020 at 8:20:57 PM UTC-6, Thomas Keffer wrote:
Thanks, Paul

Could you temporarily replace your copy of units.py with the attached? It will log some clues about what's causing the decode error.




TK: Wilco - but tomorrow (sorry for delay).

Thanks!

P.

gjr80

unread,
Jan 22, 2020, 10:16:02 PM1/22/20
to weewx-user
Hmm, looks like the extra log line is itself producing an error:

Jan 23 13:10:14 stretch40 weewx[1174] INFO weewx.manager: Added record 2020-01-23 13:10:00 AEST (1579749000) to database 'weewx.sdb'
Jan 23 13:10:14 stretch40 weewx[1174] INFO weewx.manager: Added record 2020-01-23 13:10:00 AEST (1579749000) to daily summary in 'weewx.sdb'
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.units: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: Generate failed with exception '
<type 'exceptions.UnicodeDecodeError'>'
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/Seasons/index.html.tmpl
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: **** Reason: '
ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 329, in generate
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Seasons_index_html_tmpl.py", line 214, in respond
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1615, in _handleCheetahInclude
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Seasons_current_inc.py", line 355, in respond
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 642, in filter
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****      filtered = six.text_type(val)
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/units.py", line 1051, in __str__
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****      return self.toString()
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/units.py", line 1046, in toString
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****      localize=localize)
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/units.py", line 778, in toString
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****      log.error("val_str=%s; type(val_str)=%s; s=%s; type(s)=%s" % (val_str, type(val_str), s, type(s)))
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.units: '
ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: Generate failed with exception '<type 'exceptions.UnicodeDecodeError'>'
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/Seasons/rss.xml.tmpl
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: **** Reason: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 329, in generate
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Seasons_rss_xml_tmpl.py", line 131, in respond
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 642, in filter
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****      filtered = six.text_type(val)
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/units.py", line 1051, in __str__
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****      return self.toString()
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/units.py", line 1046, in toString
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****      localize=localize)
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/units.py", line 778, in toString
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****      log.error("val_str=%s; type(val_str)=%s; s=%s; type(s)=%s" % (val_str, type(val_str), s, type(s)))
Jan 23 13:10:15 stretch40 weewx[1174] ERROR weewx.cheetahgenerator: ****  UnicodeDecodeError: '
ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)
Jan 23 13:10:15 stretch40 weewx[1174] INFO weewx.cheetahgenerator: Generated 6 files for report SeasonsReport in 0.41 seconds
Jan 23 13:10:15 stretch40 weewx[1174] INFO weewx.imagegenerator: Generated 14 images for SeasonsReport in 0.14 seconds
Jan 23 13:10:15 stretch40 weewx[1174] INFO weewx.reportengine: Copied 5 files to /home/weewx/public_html

Gary

Thomas Keffer

unread,
Jan 23, 2020, 8:35:54 AM1/23/20
to weewx-user
Grumble!

Try this one.



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

gjr80

unread,
Jan 23, 2020, 6:22:14 PM1/23/20
to weewx-user
That got it!

Gary

Jan 24 09:10:51 stretch40 weewx[777] INFO weewx.engine: Starting main packet loop.
Jan 24 09:15:16 stretch40 weewx[777] INFO weewx.manager: Added record 2020-01-24 09:15:00 AEST (1579821300) to database 'weewx.sdb'
Jan 24 09:15:16 stretch40 weewx[777] INFO weewx.manager: Added record 2020-01-24 09:15:00 AEST (1579821300) to daily summary in 'weewx.sdb'
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.units: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.units: val_str=0.3
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.units: type(val_str)=<type '
unicode'>
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.units: s=°C
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.units: type(s)=<type '
str'>
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: Generate failed with exception '
<type 'exceptions.UnicodeDecodeError'>'
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/Seasons/index.html.tmpl
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: **** Reason: '
ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 329, in generate
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Seasons_index_html_tmpl.py", line 214, in respond
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1615, in _handleCheetahInclude
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Seasons_current_inc.py", line 355, in respond
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 642, in filter
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****      filtered = six.text_type(val)
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/units.py", line 1054, in __str__
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****      return self.toString()
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/units.py", line 1049, in toString
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****      localize=localize)
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/units.py", line 775, in toString
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****      val_str += s
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.units: '
ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.units: val_str=0.3
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.units: type(val_str)=<type 'unicode'>
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.units: sC
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.units: type(s)=<type 'str'>
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: Generate failed with exception '<type 'exceptions.UnicodeDecodeError'>'
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/Seasons/rss.xml.tmpl
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: **** Reason: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 329, in generate
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Seasons_rss_xml_tmpl.py", line 131, in respond
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 642, in filter
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****      filtered = six.text_type(val)
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/units.py", line 1054, in __str__
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****      return self.toString()
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/units.py", line 1049, in toString
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****      localize=localize)
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/units.py", line 775, in toString
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****      val_str += s
Jan 24 09:15:17 stretch40 weewx[777] ERROR weewx.cheetahgenerator: ****  UnicodeDecodeError: '
ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)
Jan 24 09:15:17 stretch40 weewx[777] INFO weewx.cheetahgenerator: Generated 6 files for report SeasonsReport in 0.42 seconds
Jan 24 09:15:17 stretch40 weewx[777] INFO weewx.imagegenerator: Generated 14 images for SeasonsReport in 0.13 seconds
Jan 24 09:15:17 stretch40 weewx[777] INFO weewx.reportengine: Copied 5 files to /home/weewx/public_html



On Thursday, 23 January 2020 23:35:54 UTC+10, Thomas Keffer wrote:
Grumble!

Try this one.

Thomas Keffer

unread,
Jan 23, 2020, 6:37:04 PM1/23/20
to weewx-user
OK, now we know what went wrong, but we don't know why.

What version of ConfigObj are you using?

python2 -c "import configobj; print(configobj.__version__)"

-tk



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

gjr80

unread,
Jan 23, 2020, 6:38:31 PM1/23/20
to weewx-user
5.0.6

gary@stretch40:~/src/weewx$ python2 -c "import configobj; print(configobj.__version__)"
5.0.6

Gary
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.

Thomas Keffer

unread,
Jan 23, 2020, 6:55:20 PM1/23/20
to weewx-user
Just as I suspected. The patch that fixed things for configobj v4.7.2, broke v5.0.6. 

Can't help but feel that I'm approaching this all wrong. Got to give it a deep think.

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/6a38344c-aa3e-4d86-9425-e3fb1dda875b%40googlegroups.com.

Thomas Keffer

unread,
Jan 23, 2020, 8:07:41 PM1/23/20
to weewx-user
Try replacing your version of weewx/defaults.py with the attached and see if that helps.

Bit of a hack. I'll keep searching for something more elegant.
defaults.py

Thomas Keffer

unread,
Jan 23, 2020, 8:16:52 PM1/23/20
to weewx-user
Rats. Try this version.
defaults.py

gjr80

unread,
Jan 23, 2020, 8:30:41 PM1/23/20
to weewx-user
Ha, first version worked fine! Second version was fine too. Checked under both python 2 and 3.

Gary
Rats. Try this version.

Message has been deleted

Brent Dowell

unread,
Jan 23, 2020, 9:46:31 PM1/23/20
to weewx-user
Just installed version 4 on my PI 4, and hit this error. Came to google groups and you'd already fixed it. Awesome.
Rats. Try this version.

P Simmons

unread,
Jan 23, 2020, 11:48:40 PM1/23/20
to weewx-user

Updated to db1b41e, problem solved.

Thanks!

Paul

Thomas Keffer

unread,
Jan 24, 2020, 6:34:14 PM1/24/20
to weewx-user
Could you all do a pull and give it another try? The flow path between byte strings and unicode are more controlled now, making the results less prone to decode errors.

At least, that's the theory!

-tk

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

gjr80

unread,
Jan 24, 2020, 7:11:02 PM1/24/20
to weewx-user
Fine for me under both python2 and 3.

Gary

On Saturday, 25 January 2020 09:34:14 UTC+10, Thomas Keffer wrote:
Could you all do a pull and give it another try? The flow path between byte strings and unicode are more controlled now, making the results less prone to decode errors.

At least, that's the theory!

-tk

On Thu, Jan 23, 2020 at 8:48 PM P Simmons <mbat...@gmail.com> wrote:

Updated to db1b41e, problem solved.

Thanks!

Paul

--
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...@googlegroups.com.

P Simmons

unread,
Jan 24, 2020, 11:28:02 PM1/24/20
to weewx-user


On Friday, January 24, 2020 at 5:34:14 PM UTC-6, Thomas Keffer wrote:
Could you all do a pull and give it another try? The flow path between byte strings and unicode are more controlled now, making the results less prone to decode errors.

At least, that's the theory!

-tk

My weewx machine defaults to Python 2.7.13 .

I pulled and installed weewx-4.0.0b10 at commit 00609bf .

Everything still fine.

Thanks for your work, tk... Thanks for your testing, Gary! 

Paul

G Hammer

unread,
Jan 26, 2020, 1:04:34 PM1/26/20
to weewx-user
I just finished a new install on a new machine.
b10 works fine with Python 2.7.17 and default skin.


On Friday, January 24, 2020 at 6:34:14 PM UTC-5, Thomas Keffer wrote:
Could you all do a pull and give it another try? The flow path between byte strings and unicode are more controlled now, making the results less prone to decode errors.

At least, that's the theory!

-tk

On Thu, Jan 23, 2020 at 8:48 PM P Simmons <mbat...@gmail.com> wrote:

Updated to db1b41e, problem solved.

Thanks!

Paul

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