tags 837268 + patch
thanks

On Sat, 10 Sep 2016, Lucas Nussbaum wrote:

> Traceback (most recent call last):
>   File 
> "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/tests/test_diff.py",
>  line 317, in test_external_diff_binary
>     self.assertEqual(2, pipe.returncode)
>   File 
> "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/tests/__init__.py",
>  line 1370, in assertEqual
>     pprint.pformat(a), pprint.pformat(b)))
> AssertionError: not equal:
> a = 2
> b = 1

The reason this happens may be found in the changelog for
diffutils 1:3.5-1: diff now exit with status 1 when binary files
differ (as mandated by POSIX).

The attached patch might fix this, but I have not tested it.

> Tags: stretch sid

This bug should not happen in stretch (yet) because diffutils 3.5
has not entered stretch (yet), are you sure it's correct to tag
it stretch in those cases?

Thanks.
diff --git a/bzrlib/tests/test_diff.py b/bzrlib/tests/test_diff.py
index 0811aca..bfa68b1 100644
--- a/bzrlib/tests/test_diff.py
+++ b/bzrlib/tests/test_diff.py
@@ -313,8 +313,8 @@ class TestDiffFiles(tests.TestCaseInTempDir):
         pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                                      stdin=subprocess.PIPE)
         out, err = pipe.communicate()
-        # Diff returns '2' on Binary files.
-        self.assertEqual(2, pipe.returncode)
+        # Diff from diffutils >= 3.5 returns '1' on Binary files.
+        self.assertEqual(1, pipe.returncode)
         # We should output whatever diff tells us, plus a trailing newline
         self.assertEqual(out.splitlines(True) + ['\n'], lines)
 
diff --git a/debian/control b/debian/control
index 9d54e83..59245b0 100644
--- a/debian/control
+++ b/debian/control
@@ -10,6 +10,7 @@ Build-Depends: bash-completion,
                ca-certificates,
                cython-dbg | python-pyrex,
                debhelper (>= 9),
+               diffutils (>= 1:3.5),
                fdupes,
                python (>= 2.6.6-3),
                python-all-dbg (>= 2.6.6-3),

Reply via email to