Multiple Cheetah templates fail to compile due to wrong encoding

Bug #419750 reported by Morten Brekkevold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
High
Morten Brekkevold

Bug Description

Under newer versions of Cheetah, the template subsystem/radius/src/AcctChartsTemplate.tmpl will not compile successfully. It specifies that it is encoded using UTF-8, but in reality it's encoded as ISO-8859-1. The following error was submitted by Roger Aas:

make[1]: Entering directory `/root/nav3/nav-3.5.4/subsystem/radius'
make -C src all
make[2]: Entering directory `/root/nav3/nav-3.5.4/subsystem/radius/src'
/usr/bin/cheetah compile AcctChartsTemplate.tmpl
Compiling AcctChartsTemplate.tmpl -> AcctChartsTemplate.py
Traceback (most recent call last):
  File "/usr/bin/cheetah", line 3, in ?
    CheetahWrapper().main()
  File "/usr/lib/python2.4/site-packages/Cheetah/CheetahWrapper.py", line 149, in main
    meth()
  File "/usr/lib/python2.4/site-packages/Cheetah/CheetahWrapper.py", line 220, in compile
    self._compileOrFill()
  File "/usr/lib/python2.4/site-packages/Cheetah/CheetahWrapper.py", line 367, in _compileOrFill
    self._compileOrFillBundle(b)
  File "/usr/lib/python2.4/site-packages/Cheetah/CheetahWrapper.py", line 584, in _compileOrFillBundle
    compilerSettings=compilerSettings)
  File "/usr/lib/python2.4/site-packages/Cheetah/Template.py", line 735, in compile
    settings=(compilerSettings or {}))
  File "/usr/lib/python2.4/site-packages/Cheetah/Compiler.py", line 1587, in __init__
    source = source.decode(encoding)
  File "/usr/lib/python2.4/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 56-60: unsupported Unicode code range
make[2]: *** [AcctChartsTemplate.py] Error 1
make[2]: Leaving directory `/root/nav3/nav-3.5.4/subsystem/radius/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/nav3/nav-3.5.4/subsystem/radius'
make: *** [all] Error 1

Tags: radius
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :
Changed in nav:
status: Confirmed → Fix Committed
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

Several more Cheetah templates are actually affected by the same problem. A patch was submitted by Asbjørn Prøis, which converted the templates from ISO-8859-1 to UTF-8. The only non-ASCII characters in these files were the authors' names, and since policy now states that no NAV source code should list authors, an easier fix is to just remove the author names. I'm committing a patch for that as I write this.

summary: - AcctChartsTemplate.tmpl fails to compile due to wrong encoding
+ Multiple Cheetah templates fail to compile due to wrong encoding
Changed in nav:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.