Skip to content

Not tested: Period.strftime and PeriodIndex.strftime with non-ascii char present in the formatting string #46468

Closed
@smarie

Description

@smarie

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

  • I have checked that this issue has not already been reported.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions