Discussion:
Bug#915179: hovercraft FTBFS with Python 3.7
Adrian Bunk
2018-12-01 13:14:48 UTC
Permalink
Source: hovercraft
Version: 2.1-3
Severity: serious
Tags: ftbfs

https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/hovercraft.html

...
=================================== FAILURES ===================================
______________________ CalculateTests.test_absolute_path _______________________

positions = [{'data-x': 'r0', 'data-y': 'r0', 'is_path': True, 'path': 'M 100 100 L 300 100 L 300 300'}, {'is_path': True}, {'is_path': True}, {'is_path': True}, {'is_path': True}]

def calculate_positions(positions):
"""Calculates position information"""
current_position = {'data-x': 0,
'data-y': 0,
'data-z': 0,
'data-rotate-x': 0,
'data-rotate-y': 0,
'data-rotate-z': 0,
'data-scale': 1,
}

positer = iter(positions)
position = next(positer)
_update_position(current_position, position)

while True:

if 'path' in position:
# Start of a new path!
path = position['path']
# Follow the path specification
first_point = _pos_to_cord(current_position)

# Paths that end in Z or z are closed.
closed_path = path.strip()[-1].upper() == 'Z'
path = parse_path(path)

# Find out how many positions should be calculated:
count = 1
last = False
deferred_positions = []
while True:
try:
position = next(positer)
deferred_positions.append(position)
except StopIteration:
last = True # This path goes to the end
break
if not position.get('is_path') or 'path' in position:
# The end of the path, or the start of a new one
break
count += 1

if count < 2:
raise AssertionError("The path specification is only used for "
"one slide, which makes it pointless.")

if closed_path:
# This path closes in on itself. Skip the last part, so that
# the first and last step doesn't overlap.
endcount = count + 1
else:
endcount = count

multiplier = (endcount * DEFAULT_MOVEMENT) / path.length()
offset = path.point(0)

path_iter = iter(deferred_positions)
for x in range(count):

point = path.point(x / (endcount - 1))
point = ((point - offset) * multiplier) + first_point

current_position.update(_coord_to_pos(point))

rotation = _path_angle(path, x / (endcount - 1))
current_position['data-rotate-z'] = rotation
yield current_position.copy()
position = next(path_iter)
E StopIteration

hovercraft/position.py:189: StopIteration

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

self = <hovercraft.tests.test_position.CalculateTests testMethod=test_absolute_path>

def test_absolute_path(self):
# Position slides along a path
positions = [
{'data-x': 'r0', 'data-y': 'r0', 'path': 'M 100 100 L 300 100 L 300 300',
'is_path': True},
{'is_path': True},
{'is_path': True},
{'is_path': True},
{'is_path': True},
]
positions = list(calculate_positions(positions))
E RuntimeError: generator raised StopIteration

hovercraft/tests/test_position.py:209: RuntimeError
...

Loading...