intel / bmap-tools

BMAP Tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tests fail with Python 3.7: RuntimeError: generator raised StopIteration

smcv opened this issue · comments

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=915686

Debian and Ubuntu recently switched to Python 3.7 as their default python3 implementation. bmap-tools fails tests on that Python version:

I: pybuild base:217: /usr/bin/python3 setup.py build 
running build
running build_py
creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/bmaptools
copying bmaptools/CLI.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/bmaptools
copying bmaptools/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/bmaptools
copying bmaptools/BmapHelpers.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/bmaptools
copying bmaptools/BmapCreate.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/bmaptools
copying bmaptools/BmapCopy.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/bmaptools
copying bmaptools/Filemap.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/bmaptools
copying bmaptools/TransRead.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/bmaptools
   dh_auto_test -O--buildsystem=pybuild
I: pybuild base:217: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build; python3.7 -m unittest discover -v 
test (tests.test_api_base.TestCreateCopy) ... ERROR
test (tests.test_compat.TestCompat)
The test entry point. ... /usr/lib/python3.7/subprocess.py:852: ResourceWarning: subprocess 4090 is still running
  ResourceWarning, source=self)
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/test_compat.py:88: ResourceWarning: unclosed file <_io.BufferedReader name=9>
  image_size)
/usr/lib/python3.7/subprocess.py:852: ResourceWarning: subprocess 4093 is still running
  ResourceWarning, source=self)
/usr/lib/python3.7/subprocess.py:852: ResourceWarning: subprocess 4096 is still running
  ResourceWarning, source=self)
/usr/lib/python3.7/subprocess.py:852: ResourceWarning: subprocess 4099 is still running
  ResourceWarning, source=self)
/usr/lib/python3.7/subprocess.py:852: ResourceWarning: subprocess 4088 is still running
  ResourceWarning, source=self)
/usr/lib/python3.7/unittest/case.py:615: ResourceWarning: unclosed file <_io.BufferedReader name=8>
  testMethod()
ok
test (tests.test_filemap.TestFilemap) ... ERROR

======================================================================
ERROR: test (tests.test_api_base.TestCreateCopy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/bmaptools/Filemap.py", line 479, in get_mapped_ranges
    first_prev, last_prev = next(iterator)
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/test_api_base.py", line 259, in test
    _do_test(f_image.name, image_size, delete=delete)
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/test_api_base.py", line 165, in _do_test
    creator.generate()
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/bmaptools/BmapCreate.py", line 329, in generate
    for first, last in self.filemap.get_mapped_ranges(0, self.blocks_cnt):
RuntimeError: generator raised StopIteration

======================================================================
ERROR: test (tests.test_filemap.TestFilemap)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/bmaptools/Filemap.py", line 479, in get_mapped_ranges
    first_prev, last_prev = next(iterator)
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/test_filemap.py", line 156, in test
    _do_test(f_image, fiemap, mapped, unmapped)
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/test_filemap.py", line 118, in _do_test
    _check_ranges(f_image, filemap, first_block, blocks_cnt, mapped, "mapped")
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/tests/test_filemap.py", line 79, in _check_ranges
    for correct, check in iterator:
RuntimeError: generator raised StopIteration

----------------------------------------------------------------------
Ran 3 tests in 0.512s

FAILED (errors=2)
E: pybuild pybuild:338: test: plugin distutils failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build; python3.7 -m unittest discover -v 
dh_auto_test: pybuild --test -i python{version} -p 3.7 returned exit code 13

Full log: https://launchpadlibrarian.net/399583193/buildlog_ubuntu-disco-amd64.bmap-tools_3.5-1_BUILDING.txt.gz