diff options
author | gbrandl <devnull@localhost> | 2006-12-16 19:26:19 +0100 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2006-12-16 19:26:19 +0100 |
commit | 5e72160eaf773fa053f222b36b9e94e8975a40ff (patch) | |
tree | 37194f729b9cf6a0da07a9cd02b3fb636162a9fc /pygments/lexers/special.py | |
parent | fefdc39f7959ff9f33509470dccac559ad09e1ae (diff) | |
download | pygments-5e72160eaf773fa053f222b36b9e94e8975a40ff.tar.gz |
[svn] Fix unittest.
Diffstat (limited to 'pygments/lexers/special.py')
-rw-r--r-- | pygments/lexers/special.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pygments/lexers/special.py b/pygments/lexers/special.py index 28c382ab..5af9320a 100644 --- a/pygments/lexers/special.py +++ b/pygments/lexers/special.py @@ -60,7 +60,12 @@ class RawTokenLexer(Lexer): elif self.compress == 'bz2': import bz2 text = bz2.decompress(text) - return Lexer.get_tokens(self, text) + + # do not call Lexer.get_tokens() because we do not want Unicode + # decoding to occur, and stripping is not optional. + text = text.strip('\n') + '\n' + for i, t, v in self.get_tokens_unprocessed(text): + yield t, v def get_tokens_unprocessed(self, text): length = 0 @@ -68,7 +73,7 @@ class RawTokenLexer(Lexer): try: ttypestr, val = match.group().split('\t', 1) except ValueError: - val = match.group() + val = match.group().decode(self.encoding) ttype = Error else: ttype = _ttype_cache.get(ttypestr) |