Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faker is failing on 29th of February on the leap year #1123

Closed
defigor opened this issue Feb 29, 2020 · 0 comments · Fixed by #1124
Closed

Faker is failing on 29th of February on the leap year #1123

defigor opened this issue Feb 29, 2020 · 0 comments · Fixed by #1124

Comments

@defigor
Copy link

@defigor defigor commented Feb 29, 2020

  • Faker version: 4.0.1
  • OS: ubuntu 18.04

Currently, Faker fails to generate a date_of_birth on 29th of February on the leap year, due to the code in here:
https://github.com/joke2k/faker/blob/master/faker/providers/date_time/__init__.py#L1999

    start_date = now.replace(year=now.year - (maximum_age+1))
    end_date = now.replace(year=now.year - minimum_age)

Steps to reproduce

Execute a faker for date of birth on 29th of February

Expected behavior

Works as usual

Actual behavior

Raises exception: ValueError: day is out of range for month

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant