Pygments/pythontex : how to disable red boxes around non usual characters?

Sometimes pygments puts characters in red boxes, and I'd like to disable this feature.

In the following example:

\documentclass[a4paper,10pt]{report}
\usepackage[latin1]{inputenc}
\usepackage[francais]{babel}
\usepackage{pythontex}

\begin{document}

\begin{pygments}{python}
>>> a = "L'été sera chaud"
>>> zeros(4, 0)
AssertionError: Dimensions négatives ou nulles.
\end{pygments}

\end{document}


the first two "é" are correctly displayed, but the last one in "négatives" is boxed, and I'd like to remove this ugly box.

I apologize for this newbie question, but I couldn't find any help in the massive pygments documentation, wich is way too complex for me.

• For me, saving as Latin1 and trying to run pythontex gives errors: I can see the box you are talking about in UTF-8 encoding. Jan 19 '14 at 13:27

You could use the pycon lexer instead of python. It's made for dealing with Python console content and eliminates the problem you're seeing.
In terms of the red boxes, I usually see them around some characters (anything beyond ASCII?) that are outside of a string (or, in the pycon case, outside of a string or error message). This appears to be a limitation/bug in Pygments.
Also, in case anyone tries to compile the example: you need to run pythontex with --encoding=latin1.