Loading ...
Sorry, an error occurred while loading the content.

4376Re: [Cheetahtemplate-discuss] [PATCH] Convert unicode compiled template to an utf8 char buffer when writing to a file

Expand Messages
  • Jean-Baptiste Quenot
    Apr 3, 2009
      2009/4/2 R. Tyler Ballance <tyler@...>:

      > Aha, good to know, I'll cherry-pick it over

      Actually I don't think this patch should have ended in the 'next'
      branch, but only in the 'unicode' branch.

      I switched back to the 'next' branch and added the last unit test of
      the Unicode branch, which is actually failing:

      ERROR __main__.JBQ_UTF8_Test7.runTest ()
      ----------------------------------------------------------------------
      Traceback (most recent call last):
      File "src/Tests/Unicode.py", line 111, in runTest
      cw.main(["cheetah", "compile", "--nobackup", sourcefile])
      File "/home/jbq/nomao/packages/cheetah/Cheetah/CheetahWrapper.py",
      line 149, in main
      meth()
      File "/home/jbq/nomao/packages/cheetah/Cheetah/CheetahWrapper.py",
      line 208, in compile
      self._compileOrFill()
      File "/home/jbq/nomao/packages/cheetah/Cheetah/CheetahWrapper.py",
      line 355, in _compileOrFill
      self._compileOrFillBundle(b)
      File "/home/jbq/nomao/packages/cheetah/Cheetah/CheetahWrapper.py",
      line 590, in _compileOrFillBundle
      f.write(output.encode('utf8'))
      UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
      2835: ordinal not in range(128)

      ----------------------------------------------------------------------

      See attached patch for unit tests update.

      To fix test #7 I just issued a git revert
      158b56c8858f35669ee997ffd08a9e56aff3d75e

      Well I don't really mean to fix test #7 entirely, because anyway
      Unicode support is broken in 'next'. I mean to fix test #7 when
      sitecustomize.py sets default encoding to UTF-8.
      --
      Jean-Baptiste Quenot
      http://jbq.caraldi.com/
    • Show all 16 messages in this topic