You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to generate a Finnish ssn of a certain age the provider crashes because datetime.timedelta(days=self.generator.random.randrange(min_age * 365, max_age * 365)) is always trying to generate a time within range. The ssn provider should handle situations where min_age and max_age are the same.
For example:
if min_age == max_age:
age = datetime.timedelta(days=min_age * 365)
else:
age = datetime.timedelta(days=self.generator.random.randrange(min_age * 365, max_age * 365))
Steps to reproduce
Create a faker with fi_FI locale: fake = Faker('fi_FI')
Call the ssn provider with the same minimum and maximum age: fake.ssn(min_age=50, max_age=50, artificial=True)
Expected behavior
The faker generates an artificial Finnish ssn that is 50 years old.
Actual behavior
ValueError: empty range for randrange() (18250, 18250, 0)
The text was updated successfully, but these errors were encountered:
When attempting to generate a Finnish ssn of a certain age the provider crashes because
datetime.timedelta(days=self.generator.random.randrange(min_age * 365, max_age * 365))
is always trying to generate a time within range. The ssn provider should handle situations where min_age and max_age are the same.For example:
Steps to reproduce
fake = Faker('fi_FI')
fake.ssn(min_age=50, max_age=50, artificial=True)
Expected behavior
The faker generates an artificial Finnish ssn that is 50 years old.
Actual behavior
ValueError: empty range for randrange() (18250, 18250, 0)
The text was updated successfully, but these errors were encountered: