Skip to content

Non-zero padding formats #4

@jedzill4

Description

@jedzill4

Hi and thank you for the nice work!
I'm having an issue with non-zero padding datetime extraction, for example matching a 1/11/2017 string with format %-d/%m/%Y. The RegexGenerator class match correctly the pattern, but the DatetimeExtractor cannot extract the pattern as datetime object.

My problem is in the __parse_match_into_maybe_datetime function, in the strptime conversion. I'm using python 3.10 on linux and strptime doesn't accept the %-d directive, but can handle correctly the %d even when there is no zero padding.
From what I have read may be a platform issue and work without problems on other python implementation (anaconda maybe?). The workaround that I found is to replace all %- to their standard version (e.i. %-d to %d)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions