Not tested: Period.strftime and PeriodIndex.strftime with non-ascii char present in the formatting string · Issue #46468 · pandas-dev/pandas (original) (raw)

EDIT : as I found out this was not a bug in the main branch, I introduced it accidentally in #46405.
Therefore I rename the ticket as "not tested", meaning that current test suite does not cover this case.

Pandas version checks

Reproducible Example

import pandas as pd import locale

locale.setlocale(locale.LC_ALL, "fr_FR") per = pd.Period("2018-03-11 13:00", freq="H") assert per.strftime("%Y é") == "2018 é"

Issue Description

When there is a non-ascii character in the formatting string passed to Period.strftime the result may be corrupted. This is most probably related to an encoding error.

Expected Behavior

The assert should pass without error