+ /usr/bin/python3 setup.py pytest
running pytest
running egg_info
writing numpy_stl.egg-info/PKG-INFO
writing dependency_links to numpy_stl.egg-info/dependency_links.txt
writing entry points to numpy_stl.egg-info/entry_points.txt
writing requirements to numpy_stl.egg-info/requires.txt
writing top-level names to numpy_stl.egg-info/top_level.txt
reading manifest file 'numpy_stl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: manifest_maker: MANIFEST.in, line 1: unknown action 'include-recursive'
warning: no previously-included files matching '*.py[co]' found anywhere in distribution
no previously-included directories found matching 'docs/_build'
writing manifest file 'numpy_stl.egg-info/SOURCES.txt'
running build_ext
copying build/lib.linux-ppc64-3.6/stl/_speedups.cpython-36m-ppc64-linux-gnu.so -> stl
============================= test session starts ==============================
platform linux -- Python 3.6.0, pytest-3.0.5, py-1.4.31, pluggy-0.4.0
rootdir: /builddir/build/BUILD/numpy-stl-2.1.0, inifile:
collected 58 items
tests/test_ascii.py ..
tests/test_commandline.py FF..F...
tests/test_convert.py ......
tests/test_mesh.py ..............
tests/test_meshProperties.py FFFFFF
tests/test_multiple.py ........
tests/test_rotate.py ..............
=================================== FAILURES ===================================
_______________________________ test_main[False] _______________________________
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
mode = <Mode.AUTOMATIC: 0>, speedups = False
@classmethod
def load(cls, fh, mode=AUTOMATIC, speedups=True):
'''Load Mesh from STL file
Automatically detects binary versus ascii STL files.
:param file fh: The file handle to open
:param int mode: Automatically detect the filetype or force binary
'''
header = fh.read(HEADER_SIZE).lower()
if not header:
return
if isinstance(header, str): # pragma: no branch
header = b(header)
name = ''
if mode in (AUTOMATIC, ASCII) and header.startswith(b('solid')):
try:
name, data = cls._load_ascii(
> fh, header, speedups=speedups)
stl/stl.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
header = b'solid test.stl 2014-10-16 15:37:40.542327 halfdonut.stl '
speedups = False
@classmethod
def _load_ascii(cls, fh, header, speedups=True):
if _speedups and speedups:
return _speedups.ascii_read(fh, header)
else:
iterator = cls._ascii_reader(fh, header)
name = next(iterator)
> return name, numpy.fromiter(iterator, dtype=cls.dtype)
stl/stl.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
header = b'solid test.stl 2014-10-16 15:37:40.542327 halfdonut.stl \x01\x00\x00;\xa1n\xbc\xe6\xf5\x95=...@(\xefC>;\xc7p?\x00\x00\x83\xe1\x91=T\xf7e=H\xf2B\xbd7q6@(\xefC>;\xc7p?JA\x1d@\xe6\x04\xb5>\t\xfb\n?\x85\x080@\xe6\x04'
@classmethod
def _ascii_reader(cls, fh, header):
if b'\n' in header:
recoverable = [True]
else:
recoverable = [False]
header += b(fh.read(BUFFER_SIZE))
lines = b(header).split(b('\n'))
def get(prefix=''):
prefix = b(prefix)
if lines:
line = lines.pop(0)
else:
raise RuntimeError(recoverable[0], 'Unable to find more lines')
if not lines:
recoverable[0] = False
# Read more lines and make sure we prepend any old data
lines[:] = b(fh.read(BUFFER_SIZE)).split(b('\n'))
line += lines.pop(0)
line = line.lower().strip()
if line == b(''):
return get(prefix)
if prefix:
if line.startswith(prefix):
values = line.replace(prefix, b(''), 1).strip().split()
elif line.startswith(b('endsolid')):
# go back to the beginning of new solid part
size_unprocessedlines = sum(len(l) + 1 for l in lines) - 1
if size_unprocessedlines > 0:
position = fh.tell()
fh.seek(position - size_unprocessedlines)
raise StopIteration()
else:
raise RuntimeError(recoverable[0],
'%r should start with %r' % (line,
prefix))
if len(values) == 3:
return [float(v) for v in values]
else: # pragma: no cover
raise RuntimeError(recoverable[0],
'Incorrect value %r' % line)
else:
return b(line)
line = get()
if not line.startswith(b('solid ')) and line.startswith(b('solid')):
cls.warning('ASCII STL files should start with solid <space>. '
'The application that produced this STL file may be '
'faulty, please report this error. The erroneous '
'line: %r', line)
if not lines:
raise RuntimeError(recoverable[0],
'No lines found, impossible to read')
# Yield the name
yield line[5:].strip()
while True:
# Read from the header lines first, until that point we can recover
# and go to the binary option. After that we cannot due to
# unseekable files such as sys.stdin
#
# Numpy doesn't support any non-file types so wrapping with a
# buffer and/or StringIO does not work.
try:
> normals = get('facet normal')
stl/stl.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
prefix = b'facet normal'
def get(prefix=''):
prefix = b(prefix)
if lines:
line = lines.pop(0)
else:
raise RuntimeError(recoverable[0], 'Unable to find more lines')
if not lines:
recoverable[0] = False
# Read more lines and make sure we prepend any old data
lines[:] = b(fh.read(BUFFER_SIZE)).split(b('\n'))
line += lines.pop(0)
line = line.lower().strip()
if line == b(''):
return get(prefix)
if prefix:
if line.startswith(prefix):
values = line.replace(prefix, b(''), 1).strip().split()
elif line.startswith(b('endsolid')):
# go back to the beginning of new solid part
size_unprocessedlines = sum(len(l) + 1 for l in lines) - 1
if size_unprocessedlines > 0:
position = fh.tell()
fh.seek(position - size_unprocessedlines)
raise StopIteration()
else:
raise RuntimeError(recoverable[0],
'%r should start with %r' % (line,
> prefix))
E RuntimeError: (False, "b'!\\xbc\\xafw\\x7f>\\xe6\\x04\\xb5>\\x88e{?l\\x08\\x9e>f\\x83\\xec>\\x00\\x00\\xc0?\\xd1v\\xcc>f\\x83\\xec>\\xbe\\xa4\\x85?\\x00\\x00\\xb1\\xf5e\\xbd\\xed\\x13\\xac=\\x9f\\xf76\\xbc\\xafw\\x7f>\\xe6\\x04\\xb5>\\x88e{?4\\xf6\\x15>\\xe6\\x04\\xb5>\\x00\\x00\\xc0?l\\x08\\x9e>f\\x83\\xec>\\x00\\x00\\xc0?\\x00\\x00\\xfamj\\xbc[\\xf6\\x95=\\x9c,\\x07\\xbc\\x15x(?f\\x83\\xec>\\x15x(?\\x9a|\\x13?\\x00\\x00\\x00?w\\x04\\x8f?\\t\\xfbj?\\x00\\x00\\x00?\\t\\xfbj?\\x00\\x00c\\x02q\\xbc0\\xa8\\xb2=\\xcf\\t!\\xbc\\x15x(?f\\x83\\xec>\\x15x(?\\xd1v\\xcc>f\\x83\\xec>\\xbe\\xa4\\x85?\\x9a|\\x13?\\x00\\x00\\x00?w\\x04\\x8f?\\x00\\x00\\xfa\\x97#<\\xfa\\x88r=\\x85\\x9e\\xda;\\xfe\\x9dm?f\\x83\\xec>\\xfe\\x9dm?\\t\\xfbj?\\x00\\x00\\x00?\\t\\xfbj?\\xdc\\xbd@?f\\x83\\xec>\\x9dc\\x98?\\x00\\x00\\xfamj<\\x1f\\xf6\\x95=\\x9c,\\x07<\\xdc\\xbd@?f\\x83\\xec>\\x9dc\\x98?\\t\\xfbj?\\x00\\x00\\x00?\\t\\xfbj?\\x9a|\\x13?\\x00\\x00\\x00?w\\x04\\x8f?\\x00\\x00y8\\xba<\\x8c_$=\\xc0\\xd7x<k}\\x85?\\xe6\\x04\\xb5>k}\\x85?\\xdc\\xbd@?f\\x83\\xec>\\x9dc\\x98?x\\x1bg?\\xe6\\x04\\xb5>\\xdau\\xa0?\\x00\\x00\\xbc\\xf0\\xe8<\\x19\\x9bm=b\\xa5\\x9b<k}\\x85?\\xe6\\x04\\xb5>k}\\x85?\\xfe\\x9dm?f\\x83\\xec>\\xfe\\x9dm?\\xdc\\xbd@?f\\x83\\xec>\\x9dc\\x98?\\x00\\x00' should start with b'facet normal'")
stl/stl.py:165: RuntimeError
During handling of the above exception, another exception occurred:
ascii_file = '/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_ascii/HalfDonut.stl'
binary_file = '/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'
tmpdir = local('/tmp/pytest-of-mockbuild/pytest-0/test_main_False_0')
speedups = False
def test_main(ascii_file, binary_file, tmpdir, speedups):
original_argv = sys.argv[:]
args_pre = ['stl']
args_post = [str(tmpdir.join('output.stl'))]
if not speedups:
args_pre.append('-s')
try:
sys.argv[:] = args_pre + [ascii_file] + args_post
main.main()
sys.argv[:] = args_pre + ['-r', ascii_file] + args_post
main.main()
sys.argv[:] = args_pre + ['-a', binary_file] + args_post
> main.main()
tests/test_commandline.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
stl/main.py:53: in main
speedups=not args.disable_speedups)
stl/stl.py:314: in from_file
fh, mode=mode, speedups=speedups)
stl/stl.py:87: in load
name, data = cls._load_binary(fh, header, check_size=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
header = b'solid test.stl 2014-10-16 15:37:40.542327 halfdonut.stl '
check_size = True
@classmethod
def _load_binary(cls, fh, header, check_size=False):
# Read the triangle count
count_data = fh.read(COUNT_SIZE)
if len(count_data) != COUNT_SIZE:
count = 0
else:
count, = struct.unpack(s('@i'), b(count_data))
# raise RuntimeError()
assert count < MAX_COUNT, ('File too large, got %d triangles which '
'exceeds the maximum of %d') % (
> count, MAX_COUNT)
E AssertionError: File too large, got 536936448 triangles which exceeds the maximum of 100000000
stl/stl.py:104: AssertionError
_______________________________ test_main[True] ________________________________
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
mode = <Mode.AUTOMATIC: 0>, speedups = True
@classmethod
def load(cls, fh, mode=AUTOMATIC, speedups=True):
'''Load Mesh from STL file
Automatically detects binary versus ascii STL files.
:param file fh: The file handle to open
:param int mode: Automatically detect the filetype or force binary
'''
header = fh.read(HEADER_SIZE).lower()
if not header:
return
if isinstance(header, str): # pragma: no branch
header = b(header)
name = ''
if mode in (AUTOMATIC, ASCII) and header.startswith(b('solid')):
try:
name, data = cls._load_ascii(
> fh, header, speedups=speedups)
stl/stl.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
header = b'solid test.stl 2014-10-16 15:37:40.542327 halfdonut.stl '
speedups = True
@classmethod
def _load_ascii(cls, fh, header, speedups=True):
if _speedups and speedups:
> return _speedups.ascii_read(fh, header)
stl/stl.py:214:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> raise RuntimeError(state.recoverable,
E RuntimeError: (0, "Can't read normals (2:b'!\\xbc\\xafw\\x7f>\\xe6\\x04\\xb5>\\x88e{?l\\x08\\x9e>f\\x83\\xec>')")
stl/_speedups.pyx:120: RuntimeError
During handling of the above exception, another exception occurred:
ascii_file = '/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_ascii/HalfDonut.stl'
binary_file = '/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'
tmpdir = local('/tmp/pytest-of-mockbuild/pytest-0/test_main_True_0')
speedups = True
def test_main(ascii_file, binary_file, tmpdir, speedups):
original_argv = sys.argv[:]
args_pre = ['stl']
args_post = [str(tmpdir.join('output.stl'))]
if not speedups:
args_pre.append('-s')
try:
sys.argv[:] = args_pre + [ascii_file] + args_post
main.main()
sys.argv[:] = args_pre + ['-r', ascii_file] + args_post
main.main()
sys.argv[:] = args_pre + ['-a', binary_file] + args_post
> main.main()
tests/test_commandline.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
stl/main.py:53: in main
speedups=not args.disable_speedups)
stl/stl.py:314: in from_file
fh, mode=mode, speedups=speedups)
stl/stl.py:87: in load
name, data = cls._load_binary(fh, header, check_size=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
header = b'solid test.stl 2014-10-16 15:37:40.542327 halfdonut.stl '
check_size = True
@classmethod
def _load_binary(cls, fh, header, check_size=False):
# Read the triangle count
count_data = fh.read(COUNT_SIZE)
if len(count_data) != COUNT_SIZE:
count = 0
else:
count, = struct.unpack(s('@i'), b(count_data))
# raise RuntimeError()
assert count < MAX_COUNT, ('File too large, got %d triangles which '
'exceeds the maximum of %d') % (
> count, MAX_COUNT)
E AssertionError: File too large, got 536936448 triangles which exceeds the maximum of 100000000
stl/stl.py:104: AssertionError
______________________________ test_ascii[False] _______________________________
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
mode = <Mode.AUTOMATIC: 0>, speedups = False
@classmethod
def load(cls, fh, mode=AUTOMATIC, speedups=True):
'''Load Mesh from STL file
Automatically detects binary versus ascii STL files.
:param file fh: The file handle to open
:param int mode: Automatically detect the filetype or force binary
'''
header = fh.read(HEADER_SIZE).lower()
if not header:
return
if isinstance(header, str): # pragma: no branch
header = b(header)
name = ''
if mode in (AUTOMATIC, ASCII) and header.startswith(b('solid')):
try:
name, data = cls._load_ascii(
> fh, header, speedups=speedups)
stl/stl.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
header = b'solid test.stl 2014-10-16 15:37:40.542327 halfdonut.stl '
speedups = False
@classmethod
def _load_ascii(cls, fh, header, speedups=True):
if _speedups and speedups:
return _speedups.ascii_read(fh, header)
else:
iterator = cls._ascii_reader(fh, header)
name = next(iterator)
> return name, numpy.fromiter(iterator, dtype=cls.dtype)
stl/stl.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
header = b'solid test.stl 2014-10-16 15:37:40.542327 halfdonut.stl \x01\x00\x00;\xa1n\xbc\xe6\xf5\x95=...@(\xefC>;\xc7p?\x00\x00\x83\xe1\x91=T\xf7e=H\xf2B\xbd7q6@(\xefC>;\xc7p?JA\x1d@\xe6\x04\xb5>\t\xfb\n?\x85\x080@\xe6\x04'
@classmethod
def _ascii_reader(cls, fh, header):
if b'\n' in header:
recoverable = [True]
else:
recoverable = [False]
header += b(fh.read(BUFFER_SIZE))
lines = b(header).split(b('\n'))
def get(prefix=''):
prefix = b(prefix)
if lines:
line = lines.pop(0)
else:
raise RuntimeError(recoverable[0], 'Unable to find more lines')
if not lines:
recoverable[0] = False
# Read more lines and make sure we prepend any old data
lines[:] = b(fh.read(BUFFER_SIZE)).split(b('\n'))
line += lines.pop(0)
line = line.lower().strip()
if line == b(''):
return get(prefix)
if prefix:
if line.startswith(prefix):
values = line.replace(prefix, b(''), 1).strip().split()
elif line.startswith(b('endsolid')):
# go back to the beginning of new solid part
size_unprocessedlines = sum(len(l) + 1 for l in lines) - 1
if size_unprocessedlines > 0:
position = fh.tell()
fh.seek(position - size_unprocessedlines)
raise StopIteration()
else:
raise RuntimeError(recoverable[0],
'%r should start with %r' % (line,
prefix))
if len(values) == 3:
return [float(v) for v in values]
else: # pragma: no cover
raise RuntimeError(recoverable[0],
'Incorrect value %r' % line)
else:
return b(line)
line = get()
if not line.startswith(b('solid ')) and line.startswith(b('solid')):
cls.warning('ASCII STL files should start with solid <space>. '
'The application that produced this STL file may be '
'faulty, please report this error. The erroneous '
'line: %r', line)
if not lines:
raise RuntimeError(recoverable[0],
'No lines found, impossible to read')
# Yield the name
yield line[5:].strip()
while True:
# Read from the header lines first, until that point we can recover
# and go to the binary option. After that we cannot due to
# unseekable files such as sys.stdin
#
# Numpy doesn't support any non-file types so wrapping with a
# buffer and/or StringIO does not work.
try:
> normals = get('facet normal')
stl/stl.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
prefix = b'facet normal'
def get(prefix=''):
prefix = b(prefix)
if lines:
line = lines.pop(0)
else:
raise RuntimeError(recoverable[0], 'Unable to find more lines')
if not lines:
recoverable[0] = False
# Read more lines and make sure we prepend any old data
lines[:] = b(fh.read(BUFFER_SIZE)).split(b('\n'))
line += lines.pop(0)
line = line.lower().strip()
if line == b(''):
return get(prefix)
if prefix:
if line.startswith(prefix):
values = line.replace(prefix, b(''), 1).strip().split()
elif line.startswith(b('endsolid')):
# go back to the beginning of new solid part
size_unprocessedlines = sum(len(l) + 1 for l in lines) - 1
if size_unprocessedlines > 0:
position = fh.tell()
fh.seek(position - size_unprocessedlines)
raise StopIteration()
else:
raise RuntimeError(recoverable[0],
'%r should start with %r' % (line,
> prefix))
E RuntimeError: (False, "b'!\\xbc\\xafw\\x7f>\\xe6\\x04\\xb5>\\x88e{?l\\x08\\x9e>f\\x83\\xec>\\x00\\x00\\xc0?\\xd1v\\xcc>f\\x83\\xec>\\xbe\\xa4\\x85?\\x00\\x00\\xb1\\xf5e\\xbd\\xed\\x13\\xac=\\x9f\\xf76\\xbc\\xafw\\x7f>\\xe6\\x04\\xb5>\\x88e{?4\\xf6\\x15>\\xe6\\x04\\xb5>\\x00\\x00\\xc0?l\\x08\\x9e>f\\x83\\xec>\\x00\\x00\\xc0?\\x00\\x00\\xfamj\\xbc[\\xf6\\x95=\\x9c,\\x07\\xbc\\x15x(?f\\x83\\xec>\\x15x(?\\x9a|\\x13?\\x00\\x00\\x00?w\\x04\\x8f?\\t\\xfbj?\\x00\\x00\\x00?\\t\\xfbj?\\x00\\x00c\\x02q\\xbc0\\xa8\\xb2=\\xcf\\t!\\xbc\\x15x(?f\\x83\\xec>\\x15x(?\\xd1v\\xcc>f\\x83\\xec>\\xbe\\xa4\\x85?\\x9a|\\x13?\\x00\\x00\\x00?w\\x04\\x8f?\\x00\\x00\\xfa\\x97#<\\xfa\\x88r=\\x85\\x9e\\xda;\\xfe\\x9dm?f\\x83\\xec>\\xfe\\x9dm?\\t\\xfbj?\\x00\\x00\\x00?\\t\\xfbj?\\xdc\\xbd@?f\\x83\\xec>\\x9dc\\x98?\\x00\\x00\\xfamj<\\x1f\\xf6\\x95=\\x9c,\\x07<\\xdc\\xbd@?f\\x83\\xec>\\x9dc\\x98?\\t\\xfbj?\\x00\\x00\\x00?\\t\\xfbj?\\x9a|\\x13?\\x00\\x00\\x00?w\\x04\\x8f?\\x00\\x00y8\\xba<\\x8c_$=\\xc0\\xd7x<k}\\x85?\\xe6\\x04\\xb5>k}\\x85?\\xdc\\xbd@?f\\x83\\xec>\\x9dc\\x98?x\\x1bg?\\xe6\\x04\\xb5>\\xdau\\xa0?\\x00\\x00\\xbc\\xf0\\xe8<\\x19\\x9bm=b\\xa5\\x9b<k}\\x85?\\xe6\\x04\\xb5>k}\\x85?\\xfe\\x9dm?f\\x83\\xec>\\xfe\\x9dm?\\xdc\\xbd@?f\\x83\\xec>\\x9dc\\x98?\\x00\\x00' should start with b'facet normal'")
stl/stl.py:165: RuntimeError
During handling of the above exception, another exception occurred:
binary_file = '/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'
tmpdir = local('/tmp/pytest-of-mockbuild/pytest-0/test_ascii_False_0')
speedups = False
def test_ascii(binary_file, tmpdir, speedups):
original_argv = sys.argv[:]
try:
sys.argv[:] = [
'stl',
'-s' if not speedups else '',
binary_file,
str(tmpdir.join('ascii.stl')),
]
try:
> main.to_ascii()
tests/test_commandline.py:49:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
stl/main.py:73: in to_ascii
speedups=not args.disable_speedups)
stl/stl.py:314: in from_file
fh, mode=mode, speedups=speedups)
stl/stl.py:87: in load
name, data = cls._load_binary(fh, header, check_size=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
header = b'solid test.stl 2014-10-16 15:37:40.542327 halfdonut.stl '
check_size = True
@classmethod
def _load_binary(cls, fh, header, check_size=False):
# Read the triangle count
count_data = fh.read(COUNT_SIZE)
if len(count_data) != COUNT_SIZE:
count = 0
else:
count, = struct.unpack(s('@i'), b(count_data))
# raise RuntimeError()
assert count < MAX_COUNT, ('File too large, got %d triangles which '
'exceeds the maximum of %d') % (
> count, MAX_COUNT)
E AssertionError: File too large, got 536936448 triangles which exceeds the maximum of 100000000
stl/stl.py:104: AssertionError
__________________ test_mass_properties_for_half_donut[False] __________________
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
mode = <Mode.AUTOMATIC: 0>, speedups = False
@classmethod
def load(cls, fh, mode=AUTOMATIC, speedups=True):
'''Load Mesh from STL file
Automatically detects binary versus ascii STL files.
:param file fh: The file handle to open
:param int mode: Automatically detect the filetype or force binary
'''
header = fh.read(HEADER_SIZE).lower()
if not header:
return
if isinstance(header, str): # pragma: no branch
header = b(header)
name = ''
if mode in (AUTOMATIC, ASCII) and header.startswith(b('solid')):
try:
name, data = cls._load_ascii(
> fh, header, speedups=speedups)
stl/stl.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
header = b'solid test.stl 2014-10-16 15:37:40.542327 halfdonut.stl '
speedups = False
@classmethod
def _load_ascii(cls, fh, header, speedups=True):
if _speedups and speedups:
return _speedups.ascii_read(fh, header)
else:
iterator = cls._ascii_reader(fh, header)
name = next(iterator)
> return name, numpy.fromiter(iterator, dtype=cls.dtype)
stl/stl.py:218:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
header = b'solid test.stl 2014-10-16 15:37:40.542327 halfdonut.stl \x01\x00\x00;\xa1n\xbc\xe6\xf5\x95=...@(\xefC>;\xc7p?\x00\x00\x83\xe1\x91=T\xf7e=H\xf2B\xbd7q6@(\xefC>;\xc7p?JA\x1d@\xe6\x04\xb5>\t\xfb\n?\x85\x080@\xe6\x04'
@classmethod
def _ascii_reader(cls, fh, header):
if b'\n' in header:
recoverable = [True]
else:
recoverable = [False]
header += b(fh.read(BUFFER_SIZE))
lines = b(header).split(b('\n'))
def get(prefix=''):
prefix = b(prefix)
if lines:
line = lines.pop(0)
else:
raise RuntimeError(recoverable[0], 'Unable to find more lines')
if not lines:
recoverable[0] = False
# Read more lines and make sure we prepend any old data
lines[:] = b(fh.read(BUFFER_SIZE)).split(b('\n'))
line += lines.pop(0)
line = line.lower().strip()
if line == b(''):
return get(prefix)
if prefix:
if line.startswith(prefix):
values = line.replace(prefix, b(''), 1).strip().split()
elif line.startswith(b('endsolid')):
# go back to the beginning of new solid part
size_unprocessedlines = sum(len(l) + 1 for l in lines) - 1
if size_unprocessedlines > 0:
position = fh.tell()
fh.seek(position - size_unprocessedlines)
raise StopIteration()
else:
raise RuntimeError(recoverable[0],
'%r should start with %r' % (line,
prefix))
if len(values) == 3:
return [float(v) for v in values]
else: # pragma: no cover
raise RuntimeError(recoverable[0],
'Incorrect value %r' % line)
else:
return b(line)
line = get()
if not line.startswith(b('solid ')) and line.startswith(b('solid')):
cls.warning('ASCII STL files should start with solid <space>. '
'The application that produced this STL file may be '
'faulty, please report this error. The erroneous '
'line: %r', line)
if not lines:
raise RuntimeError(recoverable[0],
'No lines found, impossible to read')
# Yield the name
yield line[5:].strip()
while True:
# Read from the header lines first, until that point we can recover
# and go to the binary option. After that we cannot due to
# unseekable files such as sys.stdin
#
# Numpy doesn't support any non-file types so wrapping with a
# buffer and/or StringIO does not work.
try:
> normals = get('facet normal')
stl/stl.py:197:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
prefix = b'facet normal'
def get(prefix=''):
prefix = b(prefix)
if lines:
line = lines.pop(0)
else:
raise RuntimeError(recoverable[0], 'Unable to find more lines')
if not lines:
recoverable[0] = False
# Read more lines and make sure we prepend any old data
lines[:] = b(fh.read(BUFFER_SIZE)).split(b('\n'))
line += lines.pop(0)
line = line.lower().strip()
if line == b(''):
return get(prefix)
if prefix:
if line.startswith(prefix):
values = line.replace(prefix, b(''), 1).strip().split()
elif line.startswith(b('endsolid')):
# go back to the beginning of new solid part
size_unprocessedlines = sum(len(l) + 1 for l in lines) - 1
if size_unprocessedlines > 0:
position = fh.tell()
fh.seek(position - size_unprocessedlines)
raise StopIteration()
else:
raise RuntimeError(recoverable[0],
'%r should start with %r' % (line,
> prefix))
E RuntimeError: (False, "b'!\\xbc\\xafw\\x7f>\\xe6\\x04\\xb5>\\x88e{?l\\x08\\x9e>f\\x83\\xec>\\x00\\x00\\xc0?\\xd1v\\xcc>f\\x83\\xec>\\xbe\\xa4\\x85?\\x00\\x00\\xb1\\xf5e\\xbd\\xed\\x13\\xac=\\x9f\\xf76\\xbc\\xafw\\x7f>\\xe6\\x04\\xb5>\\x88e{?4\\xf6\\x15>\\xe6\\x04\\xb5>\\x00\\x00\\xc0?l\\x08\\x9e>f\\x83\\xec>\\x00\\x00\\xc0?\\x00\\x00\\xfamj\\xbc[\\xf6\\x95=\\x9c,\\x07\\xbc\\x15x(?f\\x83\\xec>\\x15x(?\\x9a|\\x13?\\x00\\x00\\x00?w\\x04\\x8f?\\t\\xfbj?\\x00\\x00\\x00?\\t\\xfbj?\\x00\\x00c\\x02q\\xbc0\\xa8\\xb2=\\xcf\\t!\\xbc\\x15x(?f\\x83\\xec>\\x15x(?\\xd1v\\xcc>f\\x83\\xec>\\xbe\\xa4\\x85?\\x9a|\\x13?\\x00\\x00\\x00?w\\x04\\x8f?\\x00\\x00\\xfa\\x97#<\\xfa\\x88r=\\x85\\x9e\\xda;\\xfe\\x9dm?f\\x83\\xec>\\xfe\\x9dm?\\t\\xfbj?\\x00\\x00\\x00?\\t\\xfbj?\\xdc\\xbd@?f\\x83\\xec>\\x9dc\\x98?\\x00\\x00\\xfamj<\\x1f\\xf6\\x95=\\x9c,\\x07<\\xdc\\xbd@?f\\x83\\xec>\\x9dc\\x98?\\t\\xfbj?\\x00\\x00\\x00?\\t\\xfbj?\\x9a|\\x13?\\x00\\x00\\x00?w\\x04\\x8f?\\x00\\x00y8\\xba<\\x8c_$=\\xc0\\xd7x<k}\\x85?\\xe6\\x04\\xb5>k}\\x85?\\xdc\\xbd@?f\\x83\\xec>\\x9dc\\x98?x\\x1bg?\\xe6\\x04\\xb5>\\xdau\\xa0?\\x00\\x00\\xbc\\xf0\\xe8<\\x19\\x9bm=b\\xa5\\x9b<k}\\x85?\\xe6\\x04\\xb5>k}\\x85?\\xfe\\x9dm?f\\x83\\xec>\\xfe\\x9dm?\\xdc\\xbd@?f\\x83\\xec>\\x9dc\\x98?\\x00\\x00' should start with b'facet normal'")
stl/stl.py:165: RuntimeError
During handling of the above exception, another exception occurred:
ascii_path = local('/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_ascii')
binary_path = local('/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary')
speedups = False
def test_mass_properties_for_half_donut(ascii_path, binary_path, speedups):
"""
Checks the results of method get_mass_properties() on
STL ASCII and binary files HalfDonut.stl
One checks the results obtained with stl
with the ones obtained with meshlab
"""
for path in (ascii_path, binary_path):
filename = path.join('HalfDonut.stl')
> mesh = stl.StlMesh(str(filename), speedups=speedups)
tests/test_meshProperties.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
stl/stl.py:318: in from_file
fh, mode=mode, speedups=speedups)
stl/stl.py:87: in load
name, data = cls._load_binary(fh, header, check_size=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
header = b'solid test.stl 2014-10-16 15:37:40.542327 halfdonut.stl '
check_size = True
@classmethod
def _load_binary(cls, fh, header, check_size=False):
# Read the triangle count
count_data = fh.read(COUNT_SIZE)
if len(count_data) != COUNT_SIZE:
count = 0
else:
count, = struct.unpack(s('@i'), b(count_data))
# raise RuntimeError()
assert count < MAX_COUNT, ('File too large, got %d triangles which '
'exceeds the maximum of %d') % (
> count, MAX_COUNT)
E AssertionError: File too large, got 536936448 triangles which exceeds the maximum of 100000000
stl/stl.py:104: AssertionError
__________________ test_mass_properties_for_half_donut[True] ___________________
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
mode = <Mode.AUTOMATIC: 0>, speedups = True
@classmethod
def load(cls, fh, mode=AUTOMATIC, speedups=True):
'''Load Mesh from STL file
Automatically detects binary versus ascii STL files.
:param file fh: The file handle to open
:param int mode: Automatically detect the filetype or force binary
'''
header = fh.read(HEADER_SIZE).lower()
if not header:
return
if isinstance(header, str): # pragma: no branch
header = b(header)
name = ''
if mode in (AUTOMATIC, ASCII) and header.startswith(b('solid')):
try:
name, data = cls._load_ascii(
> fh, header, speedups=speedups)
stl/stl.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
header = b'solid test.stl 2014-10-16 15:37:40.542327 halfdonut.stl '
speedups = True
@classmethod
def _load_ascii(cls, fh, header, speedups=True):
if _speedups and speedups:
> return _speedups.ascii_read(fh, header)
stl/stl.py:214:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> raise RuntimeError(state.recoverable,
E RuntimeError: (0, "Can't read normals (2:b'!\\xbc\\xafw\\x7f>\\xe6\\x04\\xb5>\\x88e{?l\\x08\\x9e>f\\x83\\xec>')")
stl/_speedups.pyx:120: RuntimeError
During handling of the above exception, another exception occurred:
ascii_path = local('/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_ascii')
binary_path = local('/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary')
speedups = True
def test_mass_properties_for_half_donut(ascii_path, binary_path, speedups):
"""
Checks the results of method get_mass_properties() on
STL ASCII and binary files HalfDonut.stl
One checks the results obtained with stl
with the ones obtained with meshlab
"""
for path in (ascii_path, binary_path):
filename = path.join('HalfDonut.stl')
> mesh = stl.StlMesh(str(filename), speedups=speedups)
tests/test_meshProperties.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
stl/stl.py:318: in from_file
fh, mode=mode, speedups=speedups)
stl/stl.py:87: in load
name, data = cls._load_binary(fh, header, check_size=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/HalfDonut.stl'>
header = b'solid test.stl 2014-10-16 15:37:40.542327 halfdonut.stl '
check_size = True
@classmethod
def _load_binary(cls, fh, header, check_size=False):
# Read the triangle count
count_data = fh.read(COUNT_SIZE)
if len(count_data) != COUNT_SIZE:
count = 0
else:
count, = struct.unpack(s('@i'), b(count_data))
# raise RuntimeError()
assert count < MAX_COUNT, ('File too large, got %d triangles which '
'exceeds the maximum of %d') % (
> count, MAX_COUNT)
E AssertionError: File too large, got 536936448 triangles which exceeds the maximum of 100000000
stl/stl.py:104: AssertionError
_____________________ test_mass_properties_for_moon[False] _____________________
ascii_path = local('/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_ascii')
binary_path = local('/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary')
speedups = False
def test_mass_properties_for_moon(ascii_path, binary_path, speedups):
"""
Checks the results of method get_mass_properties() on
STL ASCII and binary files Moon.stl
One checks the results obtained with stl
with the ones obtained with meshlab
"""
for path in (ascii_path, binary_path):
filename = path.join('Moon.stl')
> mesh = stl.StlMesh(str(filename), speedups=speedups)
tests/test_meshProperties.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
stl/stl.py:318: in from_file
fh, mode=mode, speedups=speedups)
stl/stl.py:89: in load
name, data = cls._load_binary(fh, header)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/Moon.stl'>
header = b'numpy-stl (1.0.0) 2014-10-16 15:37:40.642049 moon.stl '
check_size = False
@classmethod
def _load_binary(cls, fh, header, check_size=False):
# Read the triangle count
count_data = fh.read(COUNT_SIZE)
if len(count_data) != COUNT_SIZE:
count = 0
else:
count, = struct.unpack(s('@i'), b(count_data))
# raise RuntimeError()
assert count < MAX_COUNT, ('File too large, got %d triangles which '
'exceeds the maximum of %d') % (
> count, MAX_COUNT)
E AssertionError: File too large, got 1946157056 triangles which exceeds the maximum of 100000000
stl/stl.py:104: AssertionError
_____________________ test_mass_properties_for_moon[True] ______________________
ascii_path = local('/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_ascii')
binary_path = local('/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary')
speedups = True
def test_mass_properties_for_moon(ascii_path, binary_path, speedups):
"""
Checks the results of method get_mass_properties() on
STL ASCII and binary files Moon.stl
One checks the results obtained with stl
with the ones obtained with meshlab
"""
for path in (ascii_path, binary_path):
filename = path.join('Moon.stl')
> mesh = stl.StlMesh(str(filename), speedups=speedups)
tests/test_meshProperties.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
stl/stl.py:318: in from_file
fh, mode=mode, speedups=speedups)
stl/stl.py:89: in load
name, data = cls._load_binary(fh, header)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/Moon.stl'>
header = b'numpy-stl (1.0.0) 2014-10-16 15:37:40.642049 moon.stl '
check_size = False
@classmethod
def _load_binary(cls, fh, header, check_size=False):
# Read the triangle count
count_data = fh.read(COUNT_SIZE)
if len(count_data) != COUNT_SIZE:
count = 0
else:
count, = struct.unpack(s('@i'), b(count_data))
# raise RuntimeError()
assert count < MAX_COUNT, ('File too large, got %d triangles which '
'exceeds the maximum of %d') % (
> count, MAX_COUNT)
E AssertionError: File too large, got 1946157056 triangles which exceeds the maximum of 100000000
stl/stl.py:104: AssertionError
_____________________ test_mass_properties_for_star[False] _____________________
ascii_path = local('/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_ascii')
binary_path = local('/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary')
speedups = False
def test_mass_properties_for_star(ascii_path, binary_path, speedups):
"""
Checks the results of method get_mass_properties() on
STL ASCII and binary files Star.stl and
STL binary file StarWithEmptyHeader.stl (with no header)
One checks the results obtained with stl
with the ones obtained with meshlab
"""
for filename in (ascii_path.join('Star.stl'),
binary_path.join('Star.stl'),
binary_path.join('StarWithEmptyHeader.stl')):
> mesh = stl.StlMesh(str(filename), speedups=speedups)
tests/test_meshProperties.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
stl/stl.py:318: in from_file
fh, mode=mode, speedups=speedups)
stl/stl.py:89: in load
name, data = cls._load_binary(fh, header)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/Star.stl'>
header = b'numpy-stl (1.0.0) 2014-10-16 15:37:40.741314 star.stl '
check_size = False
@classmethod
def _load_binary(cls, fh, header, check_size=False):
# Read the triangle count
count_data = fh.read(COUNT_SIZE)
if len(count_data) != COUNT_SIZE:
count = 0
else:
count, = struct.unpack(s('@i'), b(count_data))
# raise RuntimeError()
assert count < MAX_COUNT, ('File too large, got %d triangles which '
'exceeds the maximum of %d') % (
> count, MAX_COUNT)
E AssertionError: File too large, got 1140850688 triangles which exceeds the maximum of 100000000
stl/stl.py:104: AssertionError
_____________________ test_mass_properties_for_star[True] ______________________
ascii_path = local('/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_ascii')
binary_path = local('/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary')
speedups = True
def test_mass_properties_for_star(ascii_path, binary_path, speedups):
"""
Checks the results of method get_mass_properties() on
STL ASCII and binary files Star.stl and
STL binary file StarWithEmptyHeader.stl (with no header)
One checks the results obtained with stl
with the ones obtained with meshlab
"""
for filename in (ascii_path.join('Star.stl'),
binary_path.join('Star.stl'),
binary_path.join('StarWithEmptyHeader.stl')):
> mesh = stl.StlMesh(str(filename), speedups=speedups)
tests/test_meshProperties.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
stl/stl.py:318: in from_file
fh, mode=mode, speedups=speedups)
stl/stl.py:89: in load
name, data = cls._load_binary(fh, header)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'stl.stl.BaseStl'>
fh = <_io.BufferedReader name='/builddir/build/BUILD/numpy-stl-2.1.0/tests/stl_binary/Star.stl'>
header = b'numpy-stl (1.0.0) 2014-10-16 15:37:40.741314 star.stl '
check_size = False
@classmethod
def _load_binary(cls, fh, header, check_size=False):
# Read the triangle count
count_data = fh.read(COUNT_SIZE)
if len(count_data) != COUNT_SIZE:
count = 0
else:
count, = struct.unpack(s('@i'), b(count_data))
# raise RuntimeError()
assert count < MAX_COUNT, ('File too large, got %d triangles which '
'exceeds the maximum of %d') % (
> count, MAX_COUNT)
E AssertionError: File too large, got 1140850688 triangles which exceeds the maximum of 100000000
stl/stl.py:104: AssertionError
===================== 9 failed, 49 passed in 1.11 seconds ======================