Skip to content

BUG: utils.testing.get_locales() #9744

@davidastephens

Description

@davidastephens

Line 334: raw_locales = [] deletes the data received from locale_getter, so the return from this function is always a blank list.

  try:
        raw_locales = locale_getter()
    except:
        return None

    try:
        # raw_locales is "\n" seperated list of locales
        # it may contain non-decodable parts, so split
        # extract what we can and then rejoin.
        raw_locales = []
        for x in raw_locales:
            try:
                raw_locales.append(str(x, encoding=pd.options.display.encoding))
            except:
                pass
    except TypeError:
        pass

    if prefix is None:
        return _valid_locales(raw_locales, normalize)

    found = re.compile('%s.*' % prefix).findall('\n'.join(raw_locales))
    return _valid_locales(found, normalize)

https://github.com/pydata/pandas/blob/8d2818e32d0bbb50e183ccb5724c391e4f604670/pandas/util/testing.py#L334

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions