Description
In the following snippet:
import numpy as np
data_proper = [(456, b'dbe', 1.2), (2, b'ded', 1.3)]
data_improper = [[456, b'dbe', 1.2], [2, b'ded', 1.3]]
descr = [('f0', '<i4'), ('f1', 'S3'), ('f2', '<f8')]
dtype = np.dtype((np.record, descr))
np.array(data_improper, dtype=dtype)
Execution of the last line in 1.13 used to raise:
TypeError: a bytes-like object is required, not 'int'
which allowed the logic in numpy/core/records.py#L676 to recover and reinterpret the line as np.array(data_proper, dtype=dtype)
.
The trouble is that in NumPy 1.14
ValueError: invalid literal for int() with base 10: b'dbe'
is being raised instead, which results in the failure.
This is a gist of the issue behind numerous test failures in pyTables when used with NumPy 1.14.