Bug#891903: diffoscope: programming error in except clause

2018-03-02 Thread Mattia Rizzolo
FTR, this happened also on ubuntu autopkgtest, where the tests fail on
armhf, arm64, ppc64el, s390x whilst it passes on x86.
http://autopkgtest.ubuntu.com/packages/diffoscope

I planned on debugging that next week (as I need to do it anyway to get it
land on ubuntu)

On Fri, Mar 2, 2018 at 11:57 AM Chris Lamb  wrote:

> Hi Zbigniew,
>
> > I'm trying to update diffoscope to version 91 in Fedora rawhide
>
> Thanks for the report!
>
> > It seem pretty clear that .decode() is called on a str object, which
> > cannot work.
>
> .. which is odd as this code as been around for ages:
>
>
> https://anonscm.debian.org/git/reproducible/diffoscope.git/commit/?id=eb070310e23e44deb6b0caaa7d022d72b13406a6
>
> I wonder if your s390x build environment has some kind of
> Unicode/terminal foo going on?
>
>
> Regards,
>
> --
>   ,''`.
>  : :'  : Chris Lamb
>  `. `'`  la...@debian.org / chris-lamb.co.uk
>`-
>
>


Bug#891903: diffoscope: programming error in except clause

2018-03-02 Thread Chris Lamb
Hi Zbigniew,

> I'm trying to update diffoscope to version 91 in Fedora rawhide

Thanks for the report!

> It seem pretty clear that .decode() is called on a str object, which 
> cannot work.

.. which is odd as this code as been around for ages:

  
https://anonscm.debian.org/git/reproducible/diffoscope.git/commit/?id=eb070310e23e44deb6b0caaa7d022d72b13406a6

I wonder if your s390x build environment has some kind of
Unicode/terminal foo going on?


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#891903: diffoscope: programming error in except clause

2018-03-02 Thread Zbigniew Jędrzejewski-Szmek
Package: diffoscope
Version: 91
Severity: normal

Dear Maintainer,

I'm trying to update diffoscope to version 91 in Fedora rawhide, and
the tests failing for reasons I haven't diagnosed yet (it builds fine
locally, but fails on an s390x builder). When the tests are failing, a
try..except clause is reached which normally wouldn't be reached, and the
code there is non-python3-compatible:

E   subprocess.CalledProcessError: Command '['objdump', 
'--line-numbers', '--disassemble', '--demangle', '--section=.text', 
'/tmp/tmp5ujok4po_diffoscope/0/2.o']' returned non-zero exit status 1.
diffoscope/feeders.py:94: CalledProcessError
During handling of the above exception, another exception occurred:
rlib1 = < 
/builddir/build/BUILD/diffoscope-91/tests/data/test1.rlib>
rlib2 = < 
/builddir/build/BUILD/diffoscope-91/tests/data/test2.rlib>
@pytest.fixture
def differences(rlib1, rlib2):
>   return rlib1.compare(rlib2).details
tests/comparators/test_rlib.py:53: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diffoscope/comparators/utils/file.py:362: in compare
difference = self._compare_using_details(other, source)
diffoscope/comparators/utils/file.py:317: in _compare_using_details
details.extend(self.as_container.compare(other.as_container, 
no_recurse=no_recurse))
diffoscope/comparators/utils/container.py:174: in compare_pair
difference = compare_files(file1, file2, source=None, 
diff_content_only=no_recurse)
diffoscope/comparators/utils/compare.py:117: in compare_files
return file1.compare(file2, source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = < alloc_system-d16b8f0e.0.o>
other = < alloc_system-d16b8f0e.0.o>, source = None
def compare(self, other, source=None):
if hasattr(self, 'compare_details') or self.as_container:
try:
difference = self._compare_using_details(other, source)
# no differences detected inside? let's at least do a binary 
diff
if difference is None:
difference = self.compare_bytes(other, source=source)
if difference is None:
return None
difference.add_comment(
"No file format specific differences found inside, "
"yet data differs ({})".format(self.magic_file_type),
)
except subprocess.CalledProcessError as e:
difference = self.compare_bytes(other, source=source)
if e.output:
>   output = re.sub(r'^', '', e.output.decode('utf-8', 
> errors='replace'), flags=re.MULTILINE)
E   AttributeError: 'str' object has no attribute 'decode'
diffoscope/comparators/utils/file.py:375: AttributeError

It seem pretty clear that .decode() is called on a str object, which cannot 
work.

The full log is at 
https://kojipkgs.fedoraproject.org//work/tasks/2918/25412918/build.log.

Zbyszek