def _get_recarray_field(array, key):

    # Numpy >= 1.10.dev recarray no longer returns chararrays for strings
    # This is currently needed for backwards-compatibility and for
    # automatic truncation of trailing whitespace
    field = np.recarray.field(array, key)
    if (field.dtype.char in ('S', 'U') and
            not isinstance(field, chararray.chararray)):
        field = field.view(chararray.chararray)
    return field
Handles losing focus.
dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/fitsrec.py/_get_recarray_field--crossover with--dataset/ETHPy150Open enthought/traitsui/traitsui/qt4/search_editor.py/SearchWidget.focusOutEvent