Re: [viewvc-users] python 2.6 exception when viewing a file containing a

"C. Michael Pilato" <[email protected]>
Newsgroups gmane.comp.version-control.cvs.viewcvs.user
Organization CollabNet, Inc.
Message-ID <[email protected]>
Tobias, what was the result of your further testing?  (Or has it not yet
occurred?)

On 09/15/2011 04:13 AM, Tobias Grüninger wrote:
>> Thanks for the bug report.  Would it be possible for you to share with us
>> the rest of this stack trace?  
> 
> Of course:
> 
> An Exception Has Occurred
> 
> Python Traceback
> 
> Traceback (most recent call last):
>   File "/usr/lib/viewvc/lib/viewvc.py", line 4317, in main
>     request.run_viewvc()
>   File "/usr/lib/viewvc/lib/viewvc.py", line 397, in run_viewvc
>     self.view_func(self)
>   File "/usr/lib/viewvc/lib/viewvc.py", line 1763, in view_markup
>     markup_or_annotate(request, 0)
>   File "/usr/lib/viewvc/lib/viewvc.py", line 1696, in markup_or_annotate
>     path[-1], mime_type)
>   File "/usr/lib/viewvc/lib/viewvc.py", line 1589, in markup_stream_pygments
>     encoding='utf-8'), ps)
>   File "/usr/lib/pymodules/python2.6/pygments/__init__.py", line 86, in highlight
>     return format(lex(code, lexer), formatter, outfile)
>   File "/usr/lib/pymodules/python2.6/pygments/__init__.py", line 45, in lex
>     return lexer.get_tokens(code)
>   File "/usr/lib/pymodules/python2.6/pygments/lexer.py", line 137, in get_tokens
>     text = text.decode('utf-8')
>   File "/usr/lib/python2.6/encodings/utf_8.py", line 16, in decode
>     return codecs.utf_8_decode(input, errors, True)
> UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 210: invalid start byte
> 
> Apparently, it happens in pygments lexer.py where this is not handled correctly:
> 
> if self.encoding == 'guess':
>     try:
>         text = text.decode('utf-8')
>         if text.startswith(u'\ufeff'):
>             text = text[len(u'\ufeff'):]
>     except UnicodeDecodeError:
>         text = text.decode('utf-8')
> elif...
> 
> but should be as 2.6 default is 'strict'
> 
> if self.encoding == 'guess':
>     try:
>         text = text.decode('utf-8')
>         if text.startswith(u'\ufeff'):
>             text = text[len(u'\ufeff'):]
>     except UnicodeDecodeError:
>         text = text.decode('utf-8', errors='replace')
> elif...
> 
> I will test when I can restart my apache.
> 
> Regards
> Tobias
> 
> ------------------------------------------------------
> http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4255&dsMessageId=2839151
> 
> To unsubscribe from this discussion, e-mail: [[email protected]].


-- 
C. Michael Pilato <[email protected]>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

------------------------------------------------------
http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4255&dsMessageId=2875996

To unsubscribe from this discussion, e-mail: [[email protected]].
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk633KMACgkQokEGqRcG/W4yhACfaHLiSxzEKCykJ/pni0F2PJvg
4I4AoL4GvjXUHhcr4ZytTArjOD0XhS0b
=PfYM
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.