[Reproducible-commits] [diffoscope] 09/09: Open file descriptors feeding diff in binary mode
Jérémy Bobbio
lunar at moszumanska.debian.org
Fri Sep 18 10:54:40 UTC 2015
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch master
in repository diffoscope.
commit a6f1d87fa69d0c02c8fbf5253ce6a8a93ab94a85
Author: Jérémy Bobbio <lunar at debian.org>
Date: Fri Sep 18 12:33:11 2015 +0200
Open file descriptors feeding diff in binary mode
We are handling encoding and decoding bytes manually when we run diff. We
encode the input to UTF-8 ourselves. We thus need to tell Python that we are
using the input file descriptor in binary mode.
This is required in Python 3 because we are writing bytes and not unicode
strings.
---
diffoscope/difference.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/diffoscope/difference.py b/diffoscope/difference.py
index 70d5b27..a1ef393 100644
--- a/diffoscope/difference.py
+++ b/diffoscope/difference.py
@@ -205,7 +205,7 @@ def feed(feeder, f, end_nl_q):
@contextmanager
def fd_from_feeder(feeder, end_nl_q):
pipe_r, pipe_w = os.pipe()
- outf = os.fdopen(pipe_w, 'w')
+ outf = os.fdopen(pipe_w, 'wb')
t = ExThread(target=feed, args=(feeder, outf, end_nl_q))
t.daemon = True
t.start()
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the Reproducible-commits
mailing list