Skip to content

thai_strftime: Output for unsupported directive looks different on Alpine #489

@bact

Description

@bact

Describe the bug

On a system that use musl (like Alpine), thai_strftime() will handle unsupported directive differently from glibc.

Although the behavior is undefined in C89 standard, the user may expect a consistent behavior across platforms.

To Reproduce

from datetime import datetime, timezone
from pythainlp.util import thai_strftime

date = datetime(1976, 10, 6, 1, 40, tzinfo=timezone.utc)
thai_strftime(date, "%Q")  # unsupported directive

Expected behavior

thai_strftime(date, "%Q") should return "Q" independently from the underlying platform.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions