From 768b900e378b0cca050d1ad5e6606b1f58a4a2d0 Mon Sep 17 00:00:00 2001 From: Debian Science Team Date: Mon, 21 Feb 2022 07:35:51 +0000 Subject: [PATCH] Don't test datetime in locales with no encoding Some datetime tests run the test in every available locale. If this set includes locales without an encoding (currently dsb_DE and sah_RU), it fails due to Python bug https://bugs.python.org/issue20088 Failure log https://tests.reproducible-builds.org/debian/rbuild/buster/amd64/pandas_0.23.3+dfsg-3.rbuild.log.gz Author: Rebecca N. Palmer Bug: https://github.com/pandas-dev/pandas/issues/20957 Forwarded: no Gbp-Pq: Name skip_noencoding_locales.patch --- pandas/_config/localization.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandas/_config/localization.py b/pandas/_config/localization.py index bc76aca9..317f7197 100644 --- a/pandas/_config/localization.py +++ b/pandas/_config/localization.py @@ -99,7 +99,10 @@ def _valid_locales(locales, normalize): def _default_locale_getter(): - return subprocess.check_output(["locale -a"], shell=True) + raw_locales = subprocess.check_output(["locale -a"], shell=True) + # skip locales without encoding, to avoid Python bug https://bugs.python.org/issue20088 + raw_locales = raw_locales.replace(b'\ndsb_DE\n',b'\n').replace(b'\nsah_RU\n',b'\n').replace(b'\ncrh_UA\n',b'\n') + return raw_locales def get_locales(prefix=None, normalize=True, locale_getter=_default_locale_getter): -- 2.30.2