Bug#988142: pandas FTBFS in buster: test failures

Adrian Bunk bunk at debian.org
Thu May 6 16:42:07 BST 2021


Source: pandas
Version: 0.23.3+dfsg-3
Severity: serious
Tags: ftbfs
Control: tags -1 fixed 0.23.3+dfsg-4

https://tests.reproducible-builds.org/debian/rb-pkg/buster/amd64/pandas.html

...
=================================== FAILURES ===================================
_____________ TestDatetime64.test_datetime_name_accessors[dsb_DE] ______________

self = <pandas.tests.indexes.datetimes.test_misc.TestDatetime64 object at 0x7f902ef24690>
time_locale = 'dsb_DE'

    @pytest.mark.parametrize('time_locale', [
        None] if tm.get_locales() is None else [None] + tm.get_locales())
    def test_datetime_name_accessors(self, time_locale):
        # Test Monday -> Sunday and January -> December, in that sequence
        if time_locale is None:
            # If the time_locale is None, day-name and month_name should
            # return the english attributes
            expected_days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday',
                             'Friday', 'Saturday', 'Sunday']
            expected_months = ['January', 'February', 'March', 'April', 'May',
                               'June', 'July', 'August', 'September',
                               'October', 'November', 'December']
        else:
            with tm.set_locale(time_locale, locale.LC_TIME):
                expected_days = calendar.day_name[:]
                expected_months = calendar.month_name[1:]
    
        # GH 11128
        dti = DatetimeIndex(freq='D', start=datetime(1998, 1, 1),
                            periods=365)
        english_days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday',
                        'Friday', 'Saturday', 'Sunday']
        for day, name, eng_name in zip(range(4, 11),
                                       expected_days,
                                       english_days):
            name = name.capitalize()
            assert dti.weekday_name[day] == eng_name
>           assert dti.day_name(locale=time_locale)[day] == name

../debian/tmp/usr/lib/python2.7/dist-packages/pandas/tests/indexes/datetimes/test_misc.py:272: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../debian/tmp/usr/lib/python2.7/dist-packages/pandas/core/indexes/datetimes.py:2553: in day_name
    locale=locale)
pandas/_libs/tslibs/fields.pyx:107: in pandas._libs.tslibs.fields.get_date_name_field
    ???
pandas/_libs/tslibs/ccalendar.pyx:213: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:229: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:230: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/strptime.pyx:396: in pandas._libs.tslibs.strptime.LocaleTime.__init__
    ???
pandas/_libs/tslibs/strptime.pyx:354: in pandas._libs.tslibs.strptime._getlang
    ???
/usr/lib/python2.7/locale.py:564: in getlocale
    return _parse_localename(localename)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

localename = 'dsb_DE'

    def _parse_localename(localename):
    
        """ Parses the locale code for localename and returns the
            result as tuple (language code, encoding).
    
            The localename is normalized and passed through the locale
            alias engine. A ValueError is raised in case the locale name
            cannot be parsed.
    
            The language code corresponds to RFC 1766.  code and encoding
            can be None in case the values cannot be determined or are
            unknown to this implementation.
    
        """
        code = normalize(localename)
        if '@' in code:
            # Deal with locale modifiers
            code, modifier = code.split('@', 1)
            if modifier == 'euro' and '.' not in code:
                # Assume Latin-9 for @euro locales. This is bogus,
                # since some systems may use other encodings for these
                # locales. Also, we ignore other modifiers.
                return code, 'iso-8859-15'
    
        if '.' in code:
            return tuple(code.split('.')[:2])
        elif code == 'C':
            return None, None
>       raise ValueError, 'unknown locale: %s' % localename
E       ValueError: unknown locale: dsb_DE

/usr/lib/python2.7/locale.py:477: ValueError
_____________ TestDatetime64.test_datetime_name_accessors[sah_RU] ______________

self = <pandas.tests.indexes.datetimes.test_misc.TestDatetime64 object at 0x7f902ee49e50>
time_locale = 'sah_RU'

    @pytest.mark.parametrize('time_locale', [
        None] if tm.get_locales() is None else [None] + tm.get_locales())
    def test_datetime_name_accessors(self, time_locale):
        # Test Monday -> Sunday and January -> December, in that sequence
        if time_locale is None:
            # If the time_locale is None, day-name and month_name should
            # return the english attributes
            expected_days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday',
                             'Friday', 'Saturday', 'Sunday']
            expected_months = ['January', 'February', 'March', 'April', 'May',
                               'June', 'July', 'August', 'September',
                               'October', 'November', 'December']
        else:
            with tm.set_locale(time_locale, locale.LC_TIME):
                expected_days = calendar.day_name[:]
                expected_months = calendar.month_name[1:]
    
        # GH 11128
        dti = DatetimeIndex(freq='D', start=datetime(1998, 1, 1),
                            periods=365)
        english_days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday',
                        'Friday', 'Saturday', 'Sunday']
        for day, name, eng_name in zip(range(4, 11),
                                       expected_days,
                                       english_days):
            name = name.capitalize()
            assert dti.weekday_name[day] == eng_name
>           assert dti.day_name(locale=time_locale)[day] == name

../debian/tmp/usr/lib/python2.7/dist-packages/pandas/tests/indexes/datetimes/test_misc.py:272: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../debian/tmp/usr/lib/python2.7/dist-packages/pandas/core/indexes/datetimes.py:2553: in day_name
    locale=locale)
pandas/_libs/tslibs/fields.pyx:107: in pandas._libs.tslibs.fields.get_date_name_field
    ???
pandas/_libs/tslibs/ccalendar.pyx:213: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:229: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:230: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/strptime.pyx:396: in pandas._libs.tslibs.strptime.LocaleTime.__init__
    ???
pandas/_libs/tslibs/strptime.pyx:354: in pandas._libs.tslibs.strptime._getlang
    ???
/usr/lib/python2.7/locale.py:564: in getlocale
    return _parse_localename(localename)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

localename = 'sah_RU'

    def _parse_localename(localename):
    
        """ Parses the locale code for localename and returns the
            result as tuple (language code, encoding).
    
            The localename is normalized and passed through the locale
            alias engine. A ValueError is raised in case the locale name
            cannot be parsed.
    
            The language code corresponds to RFC 1766.  code and encoding
            can be None in case the values cannot be determined or are
            unknown to this implementation.
    
        """
        code = normalize(localename)
        if '@' in code:
            # Deal with locale modifiers
            code, modifier = code.split('@', 1)
            if modifier == 'euro' and '.' not in code:
                # Assume Latin-9 for @euro locales. This is bogus,
                # since some systems may use other encodings for these
                # locales. Also, we ignore other modifiers.
                return code, 'iso-8859-15'
    
        if '.' in code:
            return tuple(code.split('.')[:2])
        elif code == 'C':
            return None, None
>       raise ValueError, 'unknown locale: %s' % localename
E       ValueError: unknown locale: sah_RU

/usr/lib/python2.7/locale.py:477: ValueError
_______________ TestTimestampProperties.test_names[dsb_DE-data0] _______________

self = <pandas.tests.scalar.timestamp.test_timestamp.TestTimestampProperties object at 0x7f9021248410>
data = Timestamp('2017-08-28 23:00:00'), time_locale = 'dsb_DE'

    @pytest.mark.parametrize('data',
                             [Timestamp('2017-08-28 23:00:00'),
                              Timestamp('2017-08-28 23:00:00', tz='EST')])
    @pytest.mark.parametrize('time_locale', [
        None] if tm.get_locales() is None else [None] + tm.get_locales())
    def test_names(self, data, time_locale):
        # GH 17354
        # Test .weekday_name, .day_name(), .month_name
        with tm.assert_produces_warning(FutureWarning,
                                        check_stacklevel=False):
            assert data.weekday_name == 'Monday'
        if time_locale is None:
            expected_day = 'Monday'
            expected_month = 'August'
        else:
            with tm.set_locale(time_locale, locale.LC_TIME):
                expected_day = calendar.day_name[0].capitalize()
                expected_month = calendar.month_name[8].capitalize()
    
>       assert data.day_name(time_locale) == expected_day

../debian/tmp/usr/lib/python2.7/dist-packages/pandas/tests/scalar/timestamp/test_timestamp.py:119: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pandas/_libs/tslibs/timestamps.pyx:760: in pandas._libs.tslibs.timestamps.Timestamp.day_name
    ???
pandas/_libs/tslibs/timestamps.pyx:364: in pandas._libs.tslibs.timestamps._Timestamp._get_date_name_field
    ???
pandas/_libs/tslibs/timestamps.pyx:370: in pandas._libs.tslibs.timestamps._Timestamp._get_date_name_field
    ???
pandas/_libs/tslibs/fields.pyx:107: in pandas._libs.tslibs.fields.get_date_name_field
    ???
pandas/_libs/tslibs/ccalendar.pyx:213: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:229: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:230: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/strptime.pyx:396: in pandas._libs.tslibs.strptime.LocaleTime.__init__
    ???
pandas/_libs/tslibs/strptime.pyx:354: in pandas._libs.tslibs.strptime._getlang
    ???
/usr/lib/python2.7/locale.py:564: in getlocale
    return _parse_localename(localename)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

localename = 'dsb_DE'

    def _parse_localename(localename):
    
        """ Parses the locale code for localename and returns the
            result as tuple (language code, encoding).
    
            The localename is normalized and passed through the locale
            alias engine. A ValueError is raised in case the locale name
            cannot be parsed.
    
            The language code corresponds to RFC 1766.  code and encoding
            can be None in case the values cannot be determined or are
            unknown to this implementation.
    
        """
        code = normalize(localename)
        if '@' in code:
            # Deal with locale modifiers
            code, modifier = code.split('@', 1)
            if modifier == 'euro' and '.' not in code:
                # Assume Latin-9 for @euro locales. This is bogus,
                # since some systems may use other encodings for these
                # locales. Also, we ignore other modifiers.
                return code, 'iso-8859-15'
    
        if '.' in code:
            return tuple(code.split('.')[:2])
        elif code == 'C':
            return None, None
>       raise ValueError, 'unknown locale: %s' % localename
E       ValueError: unknown locale: dsb_DE

/usr/lib/python2.7/locale.py:477: ValueError
_______________ TestTimestampProperties.test_names[dsb_DE-data1] _______________

self = <pandas.tests.scalar.timestamp.test_timestamp.TestTimestampProperties object at 0x7f902509d090>
data = Timestamp('2017-08-28 23:00:00-0500', tz='EST'), time_locale = 'dsb_DE'

    @pytest.mark.parametrize('data',
                             [Timestamp('2017-08-28 23:00:00'),
                              Timestamp('2017-08-28 23:00:00', tz='EST')])
    @pytest.mark.parametrize('time_locale', [
        None] if tm.get_locales() is None else [None] + tm.get_locales())
    def test_names(self, data, time_locale):
        # GH 17354
        # Test .weekday_name, .day_name(), .month_name
        with tm.assert_produces_warning(FutureWarning,
                                        check_stacklevel=False):
            assert data.weekday_name == 'Monday'
        if time_locale is None:
            expected_day = 'Monday'
            expected_month = 'August'
        else:
            with tm.set_locale(time_locale, locale.LC_TIME):
                expected_day = calendar.day_name[0].capitalize()
                expected_month = calendar.month_name[8].capitalize()
    
>       assert data.day_name(time_locale) == expected_day

../debian/tmp/usr/lib/python2.7/dist-packages/pandas/tests/scalar/timestamp/test_timestamp.py:119: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pandas/_libs/tslibs/timestamps.pyx:760: in pandas._libs.tslibs.timestamps.Timestamp.day_name
    ???
pandas/_libs/tslibs/timestamps.pyx:364: in pandas._libs.tslibs.timestamps._Timestamp._get_date_name_field
    ???
pandas/_libs/tslibs/timestamps.pyx:370: in pandas._libs.tslibs.timestamps._Timestamp._get_date_name_field
    ???
pandas/_libs/tslibs/fields.pyx:107: in pandas._libs.tslibs.fields.get_date_name_field
    ???
pandas/_libs/tslibs/ccalendar.pyx:213: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:229: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:230: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/strptime.pyx:396: in pandas._libs.tslibs.strptime.LocaleTime.__init__
    ???
pandas/_libs/tslibs/strptime.pyx:354: in pandas._libs.tslibs.strptime._getlang
    ???
/usr/lib/python2.7/locale.py:564: in getlocale
    return _parse_localename(localename)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

localename = 'dsb_DE'

    def _parse_localename(localename):
    
        """ Parses the locale code for localename and returns the
            result as tuple (language code, encoding).
    
            The localename is normalized and passed through the locale
            alias engine. A ValueError is raised in case the locale name
            cannot be parsed.
    
            The language code corresponds to RFC 1766.  code and encoding
            can be None in case the values cannot be determined or are
            unknown to this implementation.
    
        """
        code = normalize(localename)
        if '@' in code:
            # Deal with locale modifiers
            code, modifier = code.split('@', 1)
            if modifier == 'euro' and '.' not in code:
                # Assume Latin-9 for @euro locales. This is bogus,
                # since some systems may use other encodings for these
                # locales. Also, we ignore other modifiers.
                return code, 'iso-8859-15'
    
        if '.' in code:
            return tuple(code.split('.')[:2])
        elif code == 'C':
            return None, None
>       raise ValueError, 'unknown locale: %s' % localename
E       ValueError: unknown locale: dsb_DE

/usr/lib/python2.7/locale.py:477: ValueError
_______________ TestTimestampProperties.test_names[sah_RU-data0] _______________

self = <pandas.tests.scalar.timestamp.test_timestamp.TestTimestampProperties object at 0x7f9021b6ef50>
data = Timestamp('2017-08-28 23:00:00'), time_locale = 'sah_RU'

    @pytest.mark.parametrize('data',
                             [Timestamp('2017-08-28 23:00:00'),
                              Timestamp('2017-08-28 23:00:00', tz='EST')])
    @pytest.mark.parametrize('time_locale', [
        None] if tm.get_locales() is None else [None] + tm.get_locales())
    def test_names(self, data, time_locale):
        # GH 17354
        # Test .weekday_name, .day_name(), .month_name
        with tm.assert_produces_warning(FutureWarning,
                                        check_stacklevel=False):
            assert data.weekday_name == 'Monday'
        if time_locale is None:
            expected_day = 'Monday'
            expected_month = 'August'
        else:
            with tm.set_locale(time_locale, locale.LC_TIME):
                expected_day = calendar.day_name[0].capitalize()
                expected_month = calendar.month_name[8].capitalize()
    
>       assert data.day_name(time_locale) == expected_day

../debian/tmp/usr/lib/python2.7/dist-packages/pandas/tests/scalar/timestamp/test_timestamp.py:119: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pandas/_libs/tslibs/timestamps.pyx:760: in pandas._libs.tslibs.timestamps.Timestamp.day_name
    ???
pandas/_libs/tslibs/timestamps.pyx:364: in pandas._libs.tslibs.timestamps._Timestamp._get_date_name_field
    ???
pandas/_libs/tslibs/timestamps.pyx:370: in pandas._libs.tslibs.timestamps._Timestamp._get_date_name_field
    ???
pandas/_libs/tslibs/fields.pyx:107: in pandas._libs.tslibs.fields.get_date_name_field
    ???
pandas/_libs/tslibs/ccalendar.pyx:213: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:229: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:230: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/strptime.pyx:396: in pandas._libs.tslibs.strptime.LocaleTime.__init__
    ???
pandas/_libs/tslibs/strptime.pyx:354: in pandas._libs.tslibs.strptime._getlang
    ???
/usr/lib/python2.7/locale.py:564: in getlocale
    return _parse_localename(localename)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

localename = 'sah_RU'

    def _parse_localename(localename):
    
        """ Parses the locale code for localename and returns the
            result as tuple (language code, encoding).
    
            The localename is normalized and passed through the locale
            alias engine. A ValueError is raised in case the locale name
            cannot be parsed.
    
            The language code corresponds to RFC 1766.  code and encoding
            can be None in case the values cannot be determined or are
            unknown to this implementation.
    
        """
        code = normalize(localename)
        if '@' in code:
            # Deal with locale modifiers
            code, modifier = code.split('@', 1)
            if modifier == 'euro' and '.' not in code:
                # Assume Latin-9 for @euro locales. This is bogus,
                # since some systems may use other encodings for these
                # locales. Also, we ignore other modifiers.
                return code, 'iso-8859-15'
    
        if '.' in code:
            return tuple(code.split('.')[:2])
        elif code == 'C':
            return None, None
>       raise ValueError, 'unknown locale: %s' % localename
E       ValueError: unknown locale: sah_RU

/usr/lib/python2.7/locale.py:477: ValueError
_______________ TestTimestampProperties.test_names[sah_RU-data1] _______________

self = <pandas.tests.scalar.timestamp.test_timestamp.TestTimestampProperties object at 0x7f9020f390d0>
data = Timestamp('2017-08-28 23:00:00-0500', tz='EST'), time_locale = 'sah_RU'

    @pytest.mark.parametrize('data',
                             [Timestamp('2017-08-28 23:00:00'),
                              Timestamp('2017-08-28 23:00:00', tz='EST')])
    @pytest.mark.parametrize('time_locale', [
        None] if tm.get_locales() is None else [None] + tm.get_locales())
    def test_names(self, data, time_locale):
        # GH 17354
        # Test .weekday_name, .day_name(), .month_name
        with tm.assert_produces_warning(FutureWarning,
                                        check_stacklevel=False):
            assert data.weekday_name == 'Monday'
        if time_locale is None:
            expected_day = 'Monday'
            expected_month = 'August'
        else:
            with tm.set_locale(time_locale, locale.LC_TIME):
                expected_day = calendar.day_name[0].capitalize()
                expected_month = calendar.month_name[8].capitalize()
    
>       assert data.day_name(time_locale) == expected_day

../debian/tmp/usr/lib/python2.7/dist-packages/pandas/tests/scalar/timestamp/test_timestamp.py:119: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pandas/_libs/tslibs/timestamps.pyx:760: in pandas._libs.tslibs.timestamps.Timestamp.day_name
    ???
pandas/_libs/tslibs/timestamps.pyx:364: in pandas._libs.tslibs.timestamps._Timestamp._get_date_name_field
    ???
pandas/_libs/tslibs/timestamps.pyx:370: in pandas._libs.tslibs.timestamps._Timestamp._get_date_name_field
    ???
pandas/_libs/tslibs/fields.pyx:107: in pandas._libs.tslibs.fields.get_date_name_field
    ???
pandas/_libs/tslibs/ccalendar.pyx:213: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:229: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:230: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/strptime.pyx:396: in pandas._libs.tslibs.strptime.LocaleTime.__init__
    ???
pandas/_libs/tslibs/strptime.pyx:354: in pandas._libs.tslibs.strptime._getlang
    ???
/usr/lib/python2.7/locale.py:564: in getlocale
    return _parse_localename(localename)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

localename = 'sah_RU'

    def _parse_localename(localename):
    
        """ Parses the locale code for localename and returns the
            result as tuple (language code, encoding).
    
            The localename is normalized and passed through the locale
            alias engine. A ValueError is raised in case the locale name
            cannot be parsed.
    
            The language code corresponds to RFC 1766.  code and encoding
            can be None in case the values cannot be determined or are
            unknown to this implementation.
    
        """
        code = normalize(localename)
        if '@' in code:
            # Deal with locale modifiers
            code, modifier = code.split('@', 1)
            if modifier == 'euro' and '.' not in code:
                # Assume Latin-9 for @euro locales. This is bogus,
                # since some systems may use other encodings for these
                # locales. Also, we ignore other modifiers.
                return code, 'iso-8859-15'
    
        if '.' in code:
            return tuple(code.split('.')[:2])
        elif code == 'C':
            return None, None
>       raise ValueError, 'unknown locale: %s' % localename
E       ValueError: unknown locale: sah_RU

/usr/lib/python2.7/locale.py:477: ValueError
__ TestSeriesDatetimeValues.test_dt_accessor_datetime_name_accessors[dsb_DE] ___

self = <pandas.tests.series.test_datetime_values.TestSeriesDatetimeValues object at 0x7f9020f39d90>
time_locale = 'dsb_DE'

    @pytest.mark.parametrize('time_locale', [
        None] if tm.get_locales() is None else [None] + tm.get_locales())
    def test_dt_accessor_datetime_name_accessors(self, time_locale):
        # Test Monday -> Sunday and January -> December, in that sequence
        if time_locale is None:
            # If the time_locale is None, day-name and month_name should
            # return the english attributes
            expected_days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday',
                             'Friday', 'Saturday', 'Sunday']
            expected_months = ['January', 'February', 'March', 'April', 'May',
                               'June', 'July', 'August', 'September',
                               'October', 'November', 'December']
        else:
            with tm.set_locale(time_locale, locale.LC_TIME):
                expected_days = calendar.day_name[:]
                expected_months = calendar.month_name[1:]
    
        s = Series(DatetimeIndex(freq='D', start=datetime(1998, 1, 1),
                                 periods=365))
        english_days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday',
                        'Friday', 'Saturday', 'Sunday']
        for day, name, eng_name in zip(range(4, 11),
                                       expected_days,
                                       english_days):
            name = name.capitalize()
            assert s.dt.weekday_name[day] == eng_name
>           assert s.dt.day_name(locale=time_locale)[day] == name

../debian/tmp/usr/lib/python2.7/dist-packages/pandas/tests/series/test_datetime_values.py:305: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../debian/tmp/usr/lib/python2.7/dist-packages/pandas/core/accessor.py:89: in f
    return self._delegate_method(name, *args, **kwargs)
../debian/tmp/usr/lib/python2.7/dist-packages/pandas/core/indexes/accessors.py:99: in _delegate_method
    result = method(*args, **kwargs)
../debian/tmp/usr/lib/python2.7/dist-packages/pandas/core/indexes/datetimes.py:2553: in day_name
    locale=locale)
pandas/_libs/tslibs/fields.pyx:107: in pandas._libs.tslibs.fields.get_date_name_field
    ???
pandas/_libs/tslibs/ccalendar.pyx:213: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:229: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:230: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/strptime.pyx:396: in pandas._libs.tslibs.strptime.LocaleTime.__init__
    ???
pandas/_libs/tslibs/strptime.pyx:354: in pandas._libs.tslibs.strptime._getlang
    ???
/usr/lib/python2.7/locale.py:564: in getlocale
    return _parse_localename(localename)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

localename = 'dsb_DE'

    def _parse_localename(localename):
    
        """ Parses the locale code for localename and returns the
            result as tuple (language code, encoding).
    
            The localename is normalized and passed through the locale
            alias engine. A ValueError is raised in case the locale name
            cannot be parsed.
    
            The language code corresponds to RFC 1766.  code and encoding
            can be None in case the values cannot be determined or are
            unknown to this implementation.
    
        """
        code = normalize(localename)
        if '@' in code:
            # Deal with locale modifiers
            code, modifier = code.split('@', 1)
            if modifier == 'euro' and '.' not in code:
                # Assume Latin-9 for @euro locales. This is bogus,
                # since some systems may use other encodings for these
                # locales. Also, we ignore other modifiers.
                return code, 'iso-8859-15'
    
        if '.' in code:
            return tuple(code.split('.')[:2])
        elif code == 'C':
            return None, None
>       raise ValueError, 'unknown locale: %s' % localename
E       ValueError: unknown locale: dsb_DE

/usr/lib/python2.7/locale.py:477: ValueError
__ TestSeriesDatetimeValues.test_dt_accessor_datetime_name_accessors[sah_RU] ___

self = <pandas.tests.series.test_datetime_values.TestSeriesDatetimeValues object at 0x7f9020795990>
time_locale = 'sah_RU'

    @pytest.mark.parametrize('time_locale', [
        None] if tm.get_locales() is None else [None] + tm.get_locales())
    def test_dt_accessor_datetime_name_accessors(self, time_locale):
        # Test Monday -> Sunday and January -> December, in that sequence
        if time_locale is None:
            # If the time_locale is None, day-name and month_name should
            # return the english attributes
            expected_days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday',
                             'Friday', 'Saturday', 'Sunday']
            expected_months = ['January', 'February', 'March', 'April', 'May',
                               'June', 'July', 'August', 'September',
                               'October', 'November', 'December']
        else:
            with tm.set_locale(time_locale, locale.LC_TIME):
                expected_days = calendar.day_name[:]
                expected_months = calendar.month_name[1:]
    
        s = Series(DatetimeIndex(freq='D', start=datetime(1998, 1, 1),
                                 periods=365))
        english_days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday',
                        'Friday', 'Saturday', 'Sunday']
        for day, name, eng_name in zip(range(4, 11),
                                       expected_days,
                                       english_days):
            name = name.capitalize()
            assert s.dt.weekday_name[day] == eng_name
>           assert s.dt.day_name(locale=time_locale)[day] == name

../debian/tmp/usr/lib/python2.7/dist-packages/pandas/tests/series/test_datetime_values.py:305: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../debian/tmp/usr/lib/python2.7/dist-packages/pandas/core/accessor.py:89: in f
    return self._delegate_method(name, *args, **kwargs)
../debian/tmp/usr/lib/python2.7/dist-packages/pandas/core/indexes/accessors.py:99: in _delegate_method
    result = method(*args, **kwargs)
../debian/tmp/usr/lib/python2.7/dist-packages/pandas/core/indexes/datetimes.py:2553: in day_name
    locale=locale)
pandas/_libs/tslibs/fields.pyx:107: in pandas._libs.tslibs.fields.get_date_name_field
    ???
pandas/_libs/tslibs/ccalendar.pyx:213: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:229: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/ccalendar.pyx:230: in pandas._libs.tslibs.ccalendar.get_locale_names
    ???
pandas/_libs/tslibs/strptime.pyx:396: in pandas._libs.tslibs.strptime.LocaleTime.__init__
    ???
pandas/_libs/tslibs/strptime.pyx:354: in pandas._libs.tslibs.strptime._getlang
    ???
/usr/lib/python2.7/locale.py:564: in getlocale
    return _parse_localename(localename)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

localename = 'sah_RU'

    def _parse_localename(localename):
    
        """ Parses the locale code for localename and returns the
            result as tuple (language code, encoding).
    
            The localename is normalized and passed through the locale
            alias engine. A ValueError is raised in case the locale name
            cannot be parsed.
    
            The language code corresponds to RFC 1766.  code and encoding
            can be None in case the values cannot be determined or are
            unknown to this implementation.
    
        """
        code = normalize(localename)
        if '@' in code:
            # Deal with locale modifiers
            code, modifier = code.split('@', 1)
            if modifier == 'euro' and '.' not in code:
                # Assume Latin-9 for @euro locales. This is bogus,
                # since some systems may use other encodings for these
                # locales. Also, we ignore other modifiers.
                return code, 'iso-8859-15'
    
        if '.' in code:
            return tuple(code.split('.')[:2])
        elif code == 'C':
            return None, None
>       raise ValueError, 'unknown locale: %s' % localename
E       ValueError: unknown locale: sah_RU

/usr/lib/python2.7/locale.py:477: ValueError
...
 8 failed, 24876 passed, 2811 skipped, 742 deselected, 80 xfailed, 28 xpassed, 78 warnings in 3850.64 seconds 
make[1]: *** [debian/rules:128: python-test2.7] Error 1



More information about the debian-science-maintainers mailing list