summaryrefslogtreecommitdiff
path: root/pygments/lexer.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-10-08 01:20:11 +0200
committerGeorg Brandl <georg@python.org>2014-10-08 01:20:11 +0200
commit484583e428efde3dbea4980ffeafc53d4fe37935 (patch)
tree4102a9b4462a6069eb55bff5009a52e8e35f2314 /pygments/lexer.py
parentc0ffb8a5babc8e6d1c58b92810f1cc11ae96ff85 (diff)
downloadpygments-484583e428efde3dbea4980ffeafc53d4fe37935.tar.gz
Overhaul encoding handling in cmdline even more.
Now the encoding guessed for the input file will be used for an output file. We now always read and write to the terminal .buffer on Python 3, which allows us to override the terminal encoding and use our guessing algorithm.
Diffstat (limited to 'pygments/lexer.py')
-rw-r--r--pygments/lexer.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pygments/lexer.py b/pygments/lexer.py
index d93cb284..5b3ad358 100644
--- a/pygments/lexer.py
+++ b/pygments/lexer.py
@@ -149,7 +149,7 @@ class Lexer(object):
"""
if not isinstance(text, text_type):
if self.encoding == 'guess':
- text = guess_decode(text)
+ text, _ = guess_decode(text)
elif self.encoding == 'chardet':
try:
import chardet