diff options
author | Georg Brandl <georg@python.org> | 2012-02-06 07:49:13 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-02-06 07:49:13 +0100 |
commit | 8ba7c3fd309800a353f517ce6c374b40c47ca028 (patch) | |
tree | 65e86326f13f601f4e4767c10fd2c9efd9ff6002 /pygments/cmdline.py | |
parent | bb2f7a8bdfce72f688d1c673c087213b73f47447 (diff) | |
download | pygments-8ba7c3fd309800a353f517ce6c374b40c47ca028.tar.gz |
Closes #691: Fix Python 3 terminal highlighting with pygmentize.
Diffstat (limited to 'pygments/cmdline.py')
-rw-r--r-- | pygments/cmdline.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pygments/cmdline.py b/pygments/cmdline.py index 4eece2f9..e5b9b9b2 100644 --- a/pygments/cmdline.py +++ b/pygments/cmdline.py @@ -408,6 +408,9 @@ def main(args=sys.argv): None) or 'ascii' fmter.encoding = getattr(sys.stdout, 'encoding', None) or 'ascii' + elif not outfn and sys.version_info > (3,): + # output to terminal with encoding -> use .buffer + outfile = sys.stdout.buffer # ... and do it! try: |