[Reproducible-commits] [debbindiff] 01/03: Use same encoding as stdin when output is not a TTY

Jérémy Bobbio lunar at moszumanska.debian.org
Sun May 17 14:14:20 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository debbindiff.

commit 31a87ba4f4bce25122b9506669b11e3fdab94358
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Fri May 15 21:58:31 2015 +0000

    Use same encoding as stdin when output is not a TTY
    
    Closes: #785288
---
 debbindiff.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/debbindiff.py b/debbindiff.py
index aeec644..20a6412 100755
--- a/debbindiff.py
+++ b/debbindiff.py
@@ -61,6 +61,8 @@ def create_parser():
 def make_printer(path):
     if path == '-':
         output = sys.stdout
+        if not sys.stdout.isatty():
+            output = codecs.getwriter(sys.stdin.encoding)(sys.stdout)
     else:
         output = codecs.open(path, 'w', encoding='utf-8')
     def print_func(*args, **kwargs):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/debbindiff.git



More information about the Reproducible-commits mailing list