if isinstance(v, _numpy.ndarray):
if isinstance(s, _config.BooleanSetting):
v = bool(v) # array(True, dtype=bool) -> True
- elif v.dtype.type == _numpy.string_:
+ elif v.dtype.type in [_numpy.string_, _numpy.object_]:
if isinstance(s, _config.ListSetting):
try:
v = list(v)
if isinstance(v_, bytes):
v[i] = str(v_, 'utf-8')
else: # array('abc', dtype='|S3') -> 'abc'
+ if not v.shape:
+ # array('abc', dtype=object) -> 'abc'
+ # convert from numpy 0d array
+ v = v.item()
if _sys.version_info >= (3,):
v = str(v, 'utf-8')
else: